diff --git a/pages/API/get-current-pages/get-current-pages.test.js b/pages/API/get-current-pages/get-current-pages.test.js index 31a6c0a35ec851844b74daff8274adfd66fba11d..a8cbee3a3949d3220440cc022d9a1c4bce60a1bc 100644 --- a/pages/API/get-current-pages/get-current-pages.test.js +++ b/pages/API/get-current-pages/get-current-pages.test.js @@ -38,8 +38,11 @@ describe('getCurrentPages', () => { await page.callMethod('getPageStyle') await page.waitFor(200) - const isEnablePullDownRefresh2 = (await page.data()).currentPageStyle.enablePullDownRefresh + const data2 = await page.data() + const isEnablePullDownRefresh2 = data2.currentPageStyle.enablePullDownRefresh + const currentPageStyleIsUTSJSONObject2 = data2.currentPageStyleIsUTSJSONObject expect(isEnablePullDownRefresh2).toBe(false) + expect(currentPageStyleIsUTSJSONObject2).toBe(true) await page.callMethod('startPullDownRefresh') await page.waitFor(500) diff --git a/pages/API/get-current-pages/get-current-pages.uvue b/pages/API/get-current-pages/get-current-pages.uvue index 7a816e0d5e742164a927b4d1b98e34e70bc12859..a0c61895f943bd3a93b1661f914165a9a698eb8c 100644 --- a/pages/API/get-current-pages/get-current-pages.uvue +++ b/pages/API/get-current-pages/get-current-pages.uvue @@ -33,6 +33,7 @@ checked: false, pages: [] as Page[], currentPageStyle: {} as UTSJSONObject, + currentPageStyleIsUTSJSONObject: true, // TODO enablePullDownRefreshStatus: true } @@ -65,7 +66,8 @@ getPageStyle() { const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; - this.currentPageStyle = currentPage.$getPageStyle(); + this.currentPageStyle = currentPage.$getPageStyle(); + this.currentPageStyleIsUTSJSONObject = this.currentPageStyle instanceof UTSJSONObject }, setPageStyle(enable : boolean) { // 目前仅支持 enablePullDownRefresh