new-page-1.uvue 593 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2
<template>
  <view class="uni-padding-wrap">
DCloud-WZF's avatar
DCloud-WZF 已提交
3
    <page-head title="new-page-1" />
DCloud-WZF's avatar
DCloud-WZF 已提交
4 5 6 7
    <text>onLoad 接收到参数</text>
    <text>data: {{ data }}</text>
  </view>
</template>
DCloud-WZF's avatar
DCloud-WZF 已提交
8

DCloud-WZF's avatar
DCloud-WZF 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<script lang="ts">
import { state } from '@/store/index.uts'
export default {
  data() {
    return {
      data: '',
    }
  },
  onLoad(options: OnLoadOptions) {
    console.log('new-page2 onLoad', options)
    if (options.has('data')) {
      this.data = options.get('data')!
    }
  },
  methods: {
    // 自动化测试
    getLifeCycleNum(): number {
      return state.lifeCycleNum
    },
  },
}
</script>