vue动态绑定class,tab切换非常好用
2019-06-14 10:50
1636 查看
<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动态绑定多个class的官方实例语法无效的问题
- 详解Vue.js动态绑定class
- 详解Vue.js动态绑定class
- vue之v-for中给每个item动态绑定class,动态添加元素,动态删除某个元素的实现
- vue 中动态绑定class 和 style的方法代码详解
- vue2.0 实现click点击当前li,动态切换class
- Vue.js 动态绑定class
- vue实现切换class(与style的绑定)
- vue 点击切换变色 tab 改变class 跳转链接
- 详解vue2.0 使用动态组件实现 Tab 标签页切换效果(vue-cli)
- 详解vue2.0 使用动态组件实现 Tab 标签页切换效果(vue-cli)
- 有效解决vue动态绑定多个class的官方实例语法无效的问题
- vue动态绑定class时遇到的问题
- vue动态绑定class 选中当前列表变色
- vue动态绑定class选中当前列表变色的方法示例
- vue里如何实现tab类似的切换class?
- vue中的router-link不能动态绑定class
- vue动态绑定class的几种方式
- vue中,class的动态绑定
- vue动态绑定class