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

test: remove page hide and show

上级 18126b9d
...@@ -13,10 +13,4 @@ describe('getCurrentPages', () => { ...@@ -13,10 +13,4 @@ describe('getCurrentPages', () => {
const data = await page.data() const data = await page.data()
expect(data.checked).toBe(true) expect(data.checked).toBe(true)
}) })
it('hideAndShow', async () => {
await page.callMethod('hideAndShow')
await page.waitFor(1000)
const data = await page.data()
expect(data.showTimes).toBe(2)
})
}) })
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<page-head title="getCurrentPages"></page-head> <page-head title="getCurrentPages"></page-head>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<button @click="_getCurrentPages">getCurrentPages</button> <button @click="_getCurrentPages">getCurrentPages</button>
<button class="uni-common-mt" @click="hideAndShow">页面隐藏并显示</button>
<view v-if="pages.length" style="padding: 15px 0px"> <view v-if="pages.length" style="padding: 15px 0px">
<text>当前页面栈中 {{ pages.length }} 个页面,列表如下:</text> <text>当前页面栈中 {{ pages.length }} 个页面,列表如下:</text>
<template v-for="(page, index) in pages" :key="page.route"> <template v-for="(page, index) in pages" :key="page.route">
...@@ -26,13 +25,9 @@ export default { ...@@ -26,13 +25,9 @@ export default {
data() { data() {
return { return {
checked: false, checked: false,
showTimes: 0,
pages: [] as Page[], pages: [] as Page[],
} }
}, },
onShow() {
this.showTimes++
},
methods: { methods: {
_getCurrentPages: function () { _getCurrentPages: function () {
this.pages.length = 0 this.pages.length = 0
...@@ -48,15 +43,6 @@ export default { ...@@ -48,15 +43,6 @@ export default {
} }
} }
}, },
hideAndShow() {
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const currentPageInstance = currentPage.$getAppPage()
if (currentPageInstance != null) {
currentPageInstance.hide(new Map())
currentPageInstance.show(new Map())
}
}
}, },
} }
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册