From 558dff520854d14a49bb7874b2a7521b726a4f13 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Thu, 13 Jul 2023 15:23:50 +0800 Subject: [PATCH] fix: remove useless page & add annotation --- App.vue | 39 +-- pages/API/navigator/navigator.uvue | 224 +++++++++--------- .../API/page-lifecycle/page-lifecycle.test.js | 55 ----- pages/API/page-lifecycle/page-lifecycle.uvue | 41 ---- 4 files changed, 138 insertions(+), 221 deletions(-) delete mode 100644 pages/API/page-lifecycle/page-lifecycle.test.js delete mode 100644 pages/API/page-lifecycle/page-lifecycle.uvue diff --git a/App.vue b/App.vue index 8a258cc6..d1a2a332 100644 --- a/App.vue +++ b/App.vue @@ -2,37 +2,48 @@ import { state, setLifeCycleNum } from './store/index.uts' export default { onLaunch: function () { + // 自动化测试 setLifeCycleNum(state.lifeCycleNum + 1000) - console.log("App Launch"); + console.log('App Launch') - // const performance: Performance = uni.getPerformance() - // const observer1: PerformanceObserver = performance.createObserver((entryList: PerformanceObserverEntryList) => { - // console.log("observer1:entryList.getEntries()" + JSON.stringify(entryList.getEntries())) - // }) - // observer1.observe({ entryTypes: ['render', 'navigation'] } as PerformanceObserverOptions) + const performance: Performance = uni.getPerformance() + const observer1: PerformanceObserver = performance.createObserver( + (entryList: PerformanceObserverEntryList) => { + console.log( + 'observer1:entryList.getEntries()' + + JSON.stringify(entryList.getEntries()) + ) + } + ) + observer1.observe({ + entryTypes: ['render', 'navigation'], + } as PerformanceObserverOptions) }, onShow: function () { + // 自动化测试 setLifeCycleNum(state.lifeCycleNum + 100) - console.log("App Show"); + console.log('App Show') }, onHide: function () { + // 自动化测试 setLifeCycleNum(state.lifeCycleNum - 100) - console.log("App Hide"); + console.log('App Hide') }, onLastPageBackPress: function (): boolean | null { + // 自动化测试 setLifeCycleNum(state.lifeCycleNum - 1000) uni.showToast({ - title: "再按一次退出应用", - position: "bottom", - }); - return null; + title: '再按一次退出应用', + position: 'bottom', + }) + return null }, -}; +}