我是靠谱客的博主 开放饼干,这篇文章主要介绍element 点击切换按钮的颜色,现在分享给大家,希望可以做个参考。

1.html 

复制代码
1
2
3
4
5
6
<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.数据

复制代码
1
2
3
4
5
6
7
8
data() { return { buttonhour:'primary', buttonday:'', buttonmonth:'', } }

 3.方法

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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

最后

以上就是开放饼干最近收集整理的关于element 点击切换按钮的颜色的全部内容,更多相关element内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(50)

评论列表共有 0 条评论

立即
投稿
返回
顶部