vue show 实现简单的切换
html代码
<div :class="{active:shows==1}" @click="twshoW(1)">猜你喜欢</div>
|<div :class="{active:shows==2}" @click="jsshoW(2)">我的足迹</div>
js代码
shows:'',
}
},
methods:{
twshoW(index){
this.shows=index;
},
jsshoW(index){
this.shows=index;
}