From dfa4155c241aa42d7c6dbbdc8c2c01787676bfc5 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Thu, 13 Jul 2023 21:24:06 +0800 Subject: [PATCH] test(navigator): page lifecycle --- pages.json | 46 +++---- pages/API/navigator/navigator.uvue | 125 +++++++++++++----- pages/API/navigator/new-page/new-page.test.js | 55 ++++++++ pages/API/navigator/new-page/new-page.uvue | 55 ++++++++ .../navigator/new-page/new-uvue-page-1.uvue | 94 ------------- .../navigator/new-page/new-uvue-page-2.uvue | 76 ----------- 6 files changed, 220 insertions(+), 231 deletions(-) create mode 100644 pages/API/navigator/new-page/new-page.test.js create mode 100644 pages/API/navigator/new-page/new-page.uvue delete mode 100644 pages/API/navigator/new-page/new-uvue-page-1.uvue delete mode 100644 pages/API/navigator/new-page/new-uvue-page-2.uvue diff --git a/pages.json b/pages.json index 4f1b196a..699f9ccd 100644 --- a/pages.json +++ b/pages.json @@ -148,15 +148,9 @@ } }, { - "path": "pages/API/navigator/new-page/new-uvue-page-1", + "path": "pages/API/navigator/new-page/new-page", "style": { - "navigationBarTitleText": "新UVUE页面1" - } - }, - { - "path": "pages/API/navigator/new-page/new-uvue-page-2", - "style": { - "navigationBarTitleText": "新UVUE页面2" + "navigationBarTitleText": "新页面" } }, { @@ -597,16 +591,14 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "pages/API/get-battery-info/get-battery-info", + "style": { + "navigationBarTitleText": "电量" + } } - ,{ - "path" : "pages/API/get-battery-info/get-battery-info", - "style" : - { - "navigationBarTitleText": "电量" - } - - } - ], + ], "globalStyle": { "pageOrientation": "portrait", "navigationBarTitleText": "Hello uniapp x", @@ -621,7 +613,8 @@ "selectedColor": "#007AFF", "borderStyle": "black", "backgroundColor": "#F8F8F8", - "list": [{ + "list": [ + { "pagePath": "pages/tabBar/component", "iconPath": "static/component.png", "selectedIconPath": "static/componentHL.png", @@ -647,12 +640,15 @@ } ] }, - "condition": { //模式配置,仅开发期间生效 + "condition": { + //模式配置,仅开发期间生效 "current": 0, //当前激活的模式(list 的索引项) - "list": [{ - "name": "", //模式名称 - "path": "", //启动页面,必选 - "query": "" //启动参数,在页面的onLoad函数里面得到 - }] + "list": [ + { + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + } + ] } -} \ No newline at end of file +} diff --git a/pages/API/navigator/navigator.uvue b/pages/API/navigator/navigator.uvue index 99d5ffa4..9b05385d 100644 --- a/pages/API/navigator/navigator.uvue +++ b/pages/API/navigator/navigator.uvue @@ -2,31 +2,30 @@ - - onLoad触发时间戳: - {{ onLoadTime }} + + onLoad触发时间戳: + {{ onLoadTime }} - - onReady触发时间戳: - {{ onReadyTime }} + + onShow触发时间戳: + {{ onShowTime }} - - onUnload触发时间戳: - 见控制台 + + onReady触发时间戳: + {{ onReadyTime }} - - onShow触发时间戳: - {{ onShowTime }} + + onHide触发时间戳: + {{ onHideTime }} - - onHide触发时间戳: - {{ onHideTime }} + + onBackPress触发时间戳: + 见控制台 + + + onUnload触发时间戳: + 见控制台 - onBackPress触发时间戳:见控制台 -