vue动态绑定class,tab切换非常好用
生活随笔
收集整理的這篇文章主要介紹了
vue动态绑定class,tab切换非常好用
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
<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"
> 醫(yī)生簡介 </div>
data() {return {showLeft : true,showRight : false}
},tab(type) {if (type === 'left'){this.showLeft = truethis.showRight = false}else{this.showLeft = falsethis.showRight = true}
}
總結(jié)
以上是生活随笔為你收集整理的vue动态绑定class,tab切换非常好用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue中引入jquery
- 下一篇: uni-app 修改富文本信息中的图片样