提交 9b43bb04 编写于 作者: W wanganxp

完善getCurrentPages和启动参数的界面显示

上级 53b81578
......@@ -2,18 +2,27 @@
<view>
<page-head title="getCurrentPages"></page-head>
<button @click="getCurrentPages">getCurrentPages</button>
<text>{{result}}</text>
</view>
</template>
<script>
export default {
export default {
data() {
return {
checked: false,
result:""
}
},
methods: {
getCurrentPages: function () {
const pages = getCurrentPages()
let tmps ="当前页面栈中有" + pages.length.toString() + "个页面。列表如下:\n"
for (let i = 0; i < pages.length; i++) {
tmps = tmps + pages[i].route + "\n"
}
this.result = tmps
// console.log('pages: ',pages.toString());
// TODO 判断条件不对,需要根据自动化测试执行脚本准确验证所有栈内页面
if (pages[0].route.includes('/tabBar/')) {
this.checked = true
}
......@@ -24,5 +33,5 @@ export default {
}
},
},
}
}
</script>
\ No newline at end of file
......@@ -2,19 +2,23 @@
<view>
<page-head title="getLaunchOptionsSync"></page-head>
<button @click="getLaunchOptionsSync">getLaunchOptionsSync</button>
<text>结果:{{result}}</text>
</view>
</template>
<script>
export default {
data() {
return {
checked: false
checked: false,
result:""
}
},
methods: {
getLaunchOptionsSync: function () {
const launchOptions = uni.getLaunchOptionsSync()
if (launchOptions.path != null) {
// console.log(launchOptions)
this.result = JSON.stringify(launchOptions)
if (launchOptions.path != null) { // TODO 需要以各种方式启动hello uni-app x的包,把得到的启动参数传给调用方,进行对比
this.checked = true
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册