diff --git a/App.vue b/App.vue index 8a258cc6922f82ba5d319344f339a7ead61d129b..d1a2a332160bd4c8a4e54e30a9c096b3a458a9af 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 }, -}; +}