码迷,mamicode.com
首页 > 其他好文 > 详细

vue中绑定样式

时间:2020-03-12 15:50:54      阅读:42      评论:0      收藏:0      [点我收藏+]

标签:lse   on()   default   his   efault   false   this   click   nbsp   

<div class="title">
     <span @click="saoMa" :class="{‘active‘:color1}">扫码报修</span>
     <span @click="other" :class="{‘active‘:color2}">其他途径报修</span>
</div>
export default {
    data(){
        return{
            color1:true,
            color2:false,
        }
    },
    methods:{ 
        saoMa:function(){
        this.color1 = true; this.color2 = false; }, other:function(){
        this.color1 = false; this.color2 = true; }, } }

 

 
<style>
.active{
    color:#1057CD;
}
</style

 

vue中绑定样式

标签:lse   on()   default   his   efault   false   this   click   nbsp   

原文地址:https://www.cnblogs.com/gwkzb/p/12469689.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!