您好,欢迎来到伴沃教育。
搜索
您的当前位置:首页element 点击切换按钮的颜色

element 点击切换按钮的颜色

来源:伴沃教育

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='';
   }

  效果:

 

转载于:https://www.cnblogs.com/guangzhou11/p/9934881.html

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- bangwoyixia.com 版权所有 湘ICP备2023022004号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务