<div
@click="tab('left')"
v-bind:class="{'decoration-line':showLeft}"
class="col-xs-6 col-md-6 text-center theme-color item"
>
排班信息
</div>
<div
@click="tab('right')"
v-bind:class="{'decoration-line':showRight}"
class="col-xs-6 col-md-6 text-center item"
>
医生简介
</div>
data() {
return {
showLeft : true,
showRight : false
}
},
tab(type) {
if (type === 'left'){
this.showLeft = true
this.showRight = false
}else{
this.showLeft = false
this.showRight = true
}
}
本文介绍如何在Vue.js中使用动态绑定class实现Tab切换效果,通过v-bind:class指令结合条件判断,轻松切换不同的样式状态,达到Tab栏目的高亮效果。
508

被折叠的 条评论
为什么被折叠?



