首页 > 其他 > 详细

element 点击切换按钮的颜色

时间:2018-11-09 15:24:35      阅读:1546      评论:0      收藏:0      [点我收藏+]

1.html 

   <el-button-group label="时间">
         <el-button  @click="seeHour" :type="buttonhour"  >时</el-button>
         <el-button  @click="seeDay"  :type="buttonday"  >天</el-button>
         <el-button  @click="seeMonth" :type="buttonmonth" >月</el-button>
   </el-button-group>

2.数据

data() {
    return {
      buttonhour:‘primary‘,
      buttonday:‘‘,
      buttonmonth:‘‘,
}
}

 3.方法

seeHour() {
          this.showDay=false;
          this.showHour=true;
          this.showMonth=false;
          this.buttonhour=‘primary‘;
          this.buttonday=‘‘;
          this.buttonmonth=‘‘;
   },
   seeDay() {
          this.showDay=true;
          this.showHour=false;
          this.showMonth=false;
          this.buttonday=‘primary‘;
          this.buttonhour=‘‘;
          this.buttonmonth=‘‘;
   },
   seeMonth() {
         this.showDay=false;
         this.showHour=false;
         this.showMonth=true;
         this.buttonmonth=‘primary‘;
         this.buttonday=‘‘;
         this.buttonhour=‘‘;
   }

  效果:

技术分享图片

 

element 点击切换按钮的颜色

原文:https://www.cnblogs.com/guangzhou11/p/9934881.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!