直接上代码

<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切换,和样式切换!
Logo

前往低代码交流专区

更多推荐