提交 248b9868 编写于 作者: 雪洛's avatar 雪洛

fix: pc版首页重定向不正确

上级 01043cc7
......@@ -48,7 +48,7 @@
},
watch: {
$route: {
immediate: true,
// immediate: true,
handler(newRoute) {
const width = uni.getSystemInfoSync().windowWidth
if (width <= 768) {
......@@ -57,7 +57,11 @@
let path = newRoute.path
let category
if (path === '/') {
category = 'component'
category = 'component'
uni.redirectTo({
url: '/pages/component/global-properties/global-properties'
})
return
} else if (path.indexOf('/pages/tabBar') === 0) {
const indexPageItem = this.indexPage.find(item => item.tabBar === path)
if (!indexPageItem) {
......@@ -66,8 +70,8 @@
}
uni.redirectTo({
url: indexPageItem.index
})
category = path.split('/')[3]
})
return
} else {
category = path.split('/')[2]
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册