提交 b178eb54 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat: getLaunchOptionsSync

上级 dc831992
...@@ -2,26 +2,29 @@ ...@@ -2,26 +2,29 @@
<view> <view>
<page-head title="getLaunchOptionsSync"></page-head> <page-head title="getLaunchOptionsSync"></page-head>
<button @click="getLaunchOptionsSync">getLaunchOptionsSync</button> <button @click="getLaunchOptionsSync">getLaunchOptionsSync</button>
<text>结果:{{result}}</text> <view class="uni-common-pl uni-common-mt">
<text>应用启动路径:</text>
<text style="margin-top:5px;">{{ launchOptionsPath }}</text>
</view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
checked: false, checked: false,
result:"" homePagePath: '/pages/tabBar/component',
launchOptionsPath: '',
} }
}, },
methods: { methods: {
getLaunchOptionsSync: function () { getLaunchOptionsSync: function () {
const launchOptions = uni.getLaunchOptionsSync() const launchOptions = uni.getLaunchOptionsSync()
// console.log(launchOptions) this.launchOptionsPath = launchOptions.path
this.result = JSON.stringify(launchOptions) if (launchOptions.path == this.homePagePath) {
if (launchOptions.path != null) { // TODO 需要以各种方式启动hello uni-app x的包,把得到的启动参数传给调用方,进行对比
this.checked = true this.checked = true
} }
} },
} },
} }
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册