提交 4b5ec577 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat: getApp

上级 bb7cbcab
......@@ -147,6 +147,12 @@
"backgroundColor": "#F8F8F8"
}
},
{
"path": "pages/API/get-app/get-app",
"style": {
"navigationBarTitleText": "getApp"
}
},
{
"path": "pages/API/navigator/navigator",
"style": {
......
const PAGE_PATH = '/pages/API/get-app/get-app'
describe('getApp', () => {
it('getApp', async () => {
const page = await program.navigateTo(PAGE_PATH)
await page.waitFor(1000)
await page.callMethod('getApp')
const data = await page.data()
expect(data.checked).toBe(true)
})
})
<template>
<view>
<page-head title="getApp"></page-head>
<button @click="getApp">getApp</button>
</view>
</template>
<script>
export default {
data() {
return {
checked: false
}
},
methods: {
getApp: function () {
const app = getApp()
// TODO: JSON.stringify(app) 结果不符合预期,待客户端调整后修改逻辑
if (app != null) {
this.checked = true
}
}
}
}
</script>
<template>
<view class="uni-padding-wrap">
<page-head title="new-page-1" />
<text>onLoad 接收到参数</text>
<text>data: {{ data }}</text>
</view>
......
<template>
<view class="uni-padding-wrap container">
<page-head title="new-page-2" />
<button @click="pageScrollTo">scrollToBottom</button>
</view>
</template>
......
......@@ -50,8 +50,7 @@
pages: [
{
name: "getApp",
url: "getApp",
enable: false
url: "get-app",
},
{
name: "事件总线event-bus",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册