App.uvue 1.9 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3
<script lang="uts">
import { state, setLifeCycleNum } from '@/store/index.uts'

4 5
export default {
  onLaunch: function () {
6
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
7
    setLifeCycleNum(state.lifeCycleNum + 1000)
8
    console.log('App Launch')
9

H
hdx 已提交
10
    const performance = uni.getPerformance()
11 12 13 14 15 16 17 18 19 20 21
    const observer1: PerformanceObserver = performance.createObserver(
      (entryList: PerformanceObserverEntryList) => {
        console.log(
          'observer1:entryList.getEntries()' +
            JSON.stringify(entryList.getEntries())
        )
      }
    )
    observer1.observe({
      entryTypes: ['render', 'navigation'],
    } as PerformanceObserverOptions)
22 23
  },
  onShow: function () {
24
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
25
    setLifeCycleNum(state.lifeCycleNum + 100)
26
    console.log('App Show')
27 28
  },
  onHide: function () {
29
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
30
    setLifeCycleNum(state.lifeCycleNum - 100)
31
    console.log('App Hide')
32
  },
M
mehaotian 已提交
33
  onLastPageBackPress: function () {
34
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
35
    setLifeCycleNum(state.lifeCycleNum - 1000)
DCloud-WZF's avatar
DCloud-WZF 已提交
36
    console.log('App LastPageBackPress')
37
  },
DCloud-WZF's avatar
DCloud-WZF 已提交
38 39 40 41 42 43
  methods: {
    increasetLifeCycleNum() {
      setLifeCycleNum(state.lifeCycleNum + 100)
      console.log('App increasetLifeCycleNum')
    }
  }
44
}
Y
init  
yurj26 已提交
45 46 47
</script>

<style>
48
/*每个页面公共css */
49
@import './common/uni.css';
50 51 52 53 54 55 56 57 58 59

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

/* 顶栏通栏样式 */
/* .uni-top-window {
Y
yurj26 已提交
60 61 62 63
  	    left: 0;
  	    right: 0;
  	} */

64 65 66 67 68
uni-page-body {
  background-color: #f5f5f5 !important;
  min-height: 100% !important;
  height: auto !important;
}
Y
yurj26 已提交
69

70 71 72
.uni-top-window uni-tabbar .uni-tabbar {
  background-color: #fff !important;
}
Y
yurj26 已提交
73

74 75 76
.uni-app--showleftwindow .hideOnPc {
  display: none !important;
}
Y
yurj26 已提交
77

78 79 80 81 82 83 84
.uni-row{
	flex-direction: row;
}
.uni-column{
	flex-direction: column;
}

85 86
/* #endif */
</style>