>》>》>》>》

绑定css样式,点击高亮

<div class="flex-lay" style="color:#999">
     <div bindtap="changeType(1)" class="nav" :class="{'nav-active' : active == 1}">日报</div>
     <div bindtap="changeType(2)" class="nav" :class="{'nav-active' : active == 2}">周报</div>
     <div bindtap="changeType(3)" class="nav" :class="{'nav-active' : active == 3}">月报</div>
</div>
data: {
        active: 1
},
methods: {
        changeType(type){
               this.active = type
         },  
 } 
.nav{
        padding:20rpx 0;
}
.nav-active{
        border-bottom:4rpx solid #333;
        color:#333;
 }

 

posted @ 2019-09-05 14:58  大、锤  阅读(2597)  评论(0编辑  收藏  举报