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

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

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