watch: {
$route(to, from) {
console.log(to);
if (to.path == '/main/home') {
this.actived = 0
} else if (to.path == '/main/lesson') {
this.actived = 1
} else if (to.path == '/main/my') {
this.actived = 2
}
}
},
watch: {
$route(to, from) {
console.log(to);
if (to.path == '/main/home') {
this.actived = 0
} else if (to.path == '/main/lesson') {
this.actived = 1
} else if (to.path == '/main/my') {
this.actived = 2
}
}
},
本文标题:vue中底部tab切换,使用本地存储index,返回页面不刷新的
本文链接:https://www.haomeiwen.com/subject/sxjygftx.html
网友评论