From faa58d845717bd6d97cab68e6fb811349ca786ca Mon Sep 17 00:00:00 2001 From: shutao Date: Sat, 23 Nov 2024 16:40:25 +0800 Subject: [PATCH] =?UTF-8?q?update=20set-page-style-disable-pull-down-refre?= =?UTF-8?q?sh.uvue=20onLoad=E8=8E=B7=E5=8F=96PageStyle=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../set-page-style-disable-pull-down-refresh.test.js | 3 +-- .../set-page-style-disable-pull-down-refresh.uvue | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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 c8c27141..64ac5bf3 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 2d8d995b..973b0ba0 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() -- GitLab