get-enter-options-sync.uvue 822 字节
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() {
14 15 16 17 18 19 20 21 22 23 24
      return {
        enterOptionsString: '',
        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
  }
</script>