get-enter-options-sync.uvue 805 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <page-head title="getEnterOptionsSync"></page-head>
  3. <view class="uni-padding-wrap">
  4. <view class="uni-common-mt">
  5. <text>应用本次启动路径:</text>
  6. <text style="margin-top: 5px">{{ enterOptionsString }}</text>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. enterOptionsString: '',
  15. testResult: false
  16. }
  17. },
  18. onReady() {
  19. const app = getApp()
  20. const appOnShow = app.globalData.onShowOption
  21. const onShowOption = uni.getEnterOptionsSync()
  22. this.enterOptionsString = JSON.stringify(onShowOption, null, 2)
  23. this.testResult = (onShowOption.path == appOnShow.path && onShowOption.appScheme == appOnShow.appScheme && onShowOption.appLink == appOnShow.appLink)
  24. }
  25. }
  26. </script>