diff --git a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js index c8c2714160746a9fd209f17925cd5ce528d37139..64ac5bf3843a08d7926ede22620562d15e89d2c0 100644 --- a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js +++ b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js @@ -13,8 +13,7 @@ describe('getCurrentPages', () => { let page it('page-style', async () => { page = await program.navigateTo(PAGE_PATH) - - await page.callMethod('getPageStyle') + //onLoad会对currentPageStyle赋值 await page.waitFor(200) const currentPageStyle = (await page.data()).currentPageStyle const isEnablePullDownRefresh1 = currentPageStyle.enablePullDownRefresh diff --git a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue index 2d8d995b9cbeab6683343f75116348af1e5c6267..973b0ba00606edde27b025dc1c609d6541653f6b 100644 --- a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue +++ b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue @@ -35,6 +35,12 @@ return JSON.stringify(this.currentPageStyle) } }, + onLoad() { + const pages = getCurrentPages(); + const currentPage = pages[pages.length - 1]; + this.currentPageStyle = currentPage.getPageStyle(); + this.enablePullDownRefreshStatus = this.currentPageStyle["enablePullDownRefresh"] as boolean + }, onPullDownRefresh() { setTimeout(() => { uni.stopPullDownRefresh()