话不多说看图。不解的我们可以评论区讨论
HTML
:class 绑定一个active,show 依次等于1234;@click链接跳转页面名
script
data(){
return {
show:1
}
},
},
methods: {
skip(a){
this.$router.push(a);
// this.active = a;
},
zhiyumain() {
this.show =1;
this.$router.push('/zhiyumain')
}, accountMane() {
this.show = 2;
this.$router.push('/accountMane')
},user() {
this.show = 3;
this.$router.push('/user')
},
}
跳转页面的hi。顺序展示active 的样式
## css
.active{
color: #fff;
background-color: #337ab7;
border-radius: 5px;
}
基本就是这样做出来的了