App.vue 1.6 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1
<script lang="ts">
DCloud-WZF's avatar
DCloud-WZF 已提交
2
import { state, setLifeCycleNum } from './store/index.uts'
3 4
export default {
  onLaunch: function () {
5
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
6
    setLifeCycleNum(state.lifeCycleNum + 1000)
7
    console.log('App Launch')
8

9 10 11 12 13 14 15 16 17 18 19 20
    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)
21 22
  },
  onShow: function () {
23
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
24
    setLifeCycleNum(state.lifeCycleNum + 100)
25
    console.log('App Show')
26 27
  },
  onHide: function () {
28
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
29
    setLifeCycleNum(state.lifeCycleNum - 100)
30
    console.log('App Hide')
31 32
  },
  onLastPageBackPress: function (): boolean | null {
33
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
34
    setLifeCycleNum(state.lifeCycleNum - 1000)
35
    return null
36
  },
37
}
Y
init  
yurj26 已提交
38 39 40
</script>

<style>
41
/*每个页面公共css */
42
@import './common/uni.css';
43 44 45 46 47 48 49 50 51 52

/* #ifdef H5 */
@media screen and (min-width: 768px) {
  body {
    overflow-y: scroll;
  }
}

/* 顶栏通栏样式 */
/* .uni-top-window {
Y
yurj26 已提交
53 54 55 56
  	    left: 0;
  	    right: 0;
  	} */

57 58 59 60 61
uni-page-body {
  background-color: #f5f5f5 !important;
  min-height: 100% !important;
  height: auto !important;
}
Y
yurj26 已提交
62

63 64 65
.uni-top-window uni-tabbar .uni-tabbar {
  background-color: #fff !important;
}
Y
yurj26 已提交
66

67 68 69
.uni-app--showleftwindow .hideOnPc {
  display: none !important;
}
Y
yurj26 已提交
70

71 72
/* #endif */
</style>