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

fix(getLaunchOptionsSync): 优化示例

上级 e3c001fd
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
data() { data() {
return { return {
checked: false, checked: false,
homePagePath: '/pages/tabBar/component', homePagePath: 'pages/tabBar/component',
launchOptionsPath: '', launchOptionsPath: '',
} }
}, },
...@@ -22,7 +22,8 @@ export default { ...@@ -22,7 +22,8 @@ export default {
getLaunchOptionsSync() { getLaunchOptionsSync() {
const launchOptions = uni.getLaunchOptionsSync() const launchOptions = uni.getLaunchOptionsSync()
this.launchOptionsPath = launchOptions.path this.launchOptionsPath = launchOptions.path
if (launchOptions.path === this.homePagePath || `/${launchOptions.path}` === this.homePagePath) {
if (launchOptions.path == this.homePagePath) {
this.checked = true this.checked = true
} }
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册