vue动态绑定class,tab切换非常好用
直接上代码<div @click="tab('left')" v-bind:class="{'decoration-line':showLeft}" class="col-xs-6 col-md-6 text-center theme-color item">排班信息</div>&a
·
直接上代码
<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 } }这样就可以实现tab切换,和样式切换!
更多推荐
已为社区贡献12条内容
所有评论(0)