get-enter-options-sync.uvue 831 字节
Newer Older
1 2 3
<template>
  <page-head title="getEnterOptionsSync"></page-head>
  <view class="uni-padding-wrap">
4 5 6
    <view class="uni-common-mt">
      <text>应用本次启动路径:</text>
      <text style="margin-top: 5px">{{ enterOptionsString }}</text>
7 8 9 10
    </view>
  </view>
</template>

11
<script>
12 13
  export default {
    data() {
DCloud-WZF's avatar
DCloud-WZF 已提交
14
      return {
15
        enterOptionsString: '',
DCloud-WZF's avatar
DCloud-WZF 已提交
16 17 18 19 20 21 22 23 24
        testResult: false
      }
    },
    onReady() {
      const app = getApp()
      const appOnShow = app.globalData.onShowOption
      const onShowOption = uni.getEnterOptionsSync()
      this.enterOptionsString = JSON.stringify(onShowOption, null, 2)
      this.testResult = (onShowOption.path == appOnShow.path && onShowOption.appScheme == appOnShow.appScheme && onShowOption.appLink == appOnShow.appLink)
25
    }
26 27
  }
</script>