diff --git a/pages.json b/pages.json index 73dab942d1955b36f0747e3671759ff5cdde39ab..522bedc48073dcee95a3847d293cb4ea2a8de115 100644 --- a/pages.json +++ b/pages.json @@ -153,6 +153,12 @@ "navigationBarTitleText": "getApp" } }, + { + "path": "pages/API/get-current-pages/get-current-pages", + "style": { + "navigationBarTitleText": "getCurrentPages" + } + }, { "path": "pages/API/navigator/navigator", "style": { diff --git a/pages/API/get-current-pages/get-current-pages.test.js b/pages/API/get-current-pages/get-current-pages.test.js new file mode 100644 index 0000000000000000000000000000000000000000..f380eecaaa3f82b54f79e79941bf8a33be355808 --- /dev/null +++ b/pages/API/get-current-pages/get-current-pages.test.js @@ -0,0 +1,11 @@ +const PAGE_PATH = '/pages/API/get-current-pages/get-current-pages' + +describe('getCurrentPages', () => { + it('getCurrentPages', async () => { + const page = await program.navigateTo(PAGE_PATH) + await page.waitFor(1000) + await page.callMethod('getCurrentPages') + const data = await page.data() + expect(data.checked).toBe(true) + }) +}) diff --git a/pages/API/get-current-pages/get-current-pages.uvue b/pages/API/get-current-pages/get-current-pages.uvue new file mode 100644 index 0000000000000000000000000000000000000000..f454273b4433b6c07993acb8d4d179a632ae0488 --- /dev/null +++ b/pages/API/get-current-pages/get-current-pages.uvue @@ -0,0 +1,28 @@ + + diff --git a/pages/tabBar/API.uvue b/pages/tabBar/API.uvue index ce6af2e5b5b83a2aec02e2ee833f5f373ddca6f5..1624fc0ec5e759f88a4eb28a9d7e931bf3722421 100644 --- a/pages/tabBar/API.uvue +++ b/pages/tabBar/API.uvue @@ -48,10 +48,14 @@ name: "基础", open: false, pages: [ - { + { name: "getApp", url: "get-app", - }, + }, + { + name: "getCurrentPages", + url: "get-current-pages", + }, { name: "事件总线event-bus", url: "event-bus",