我是靠谱客的博主 慈祥钻石,这篇文章主要介绍单选框_vue实现单选框自定义样式,现在分享给大家,希望可以做个参考。

话不多说先看效果再看代码,后期推出多选和其他的代码

0a718062e3cda2f796e0da404135834c.png

c4840b24b4a5951455a74e61f4116d97.png
复制代码
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<style lang="less" scoped> .CancelOrderCause-layout { font-family: PingFang SC; background: #f6f6f6; width: 100%; height: 100%; overflow-y: scroll; .cancel-list { width: 100%; height: auto; padding-bottom: 0.2rem; .cancel-title { background: #ffffff; margin-top: 0.2rem; width: 100%; height: 1.18rem; border-radius: 0.2rem 0.2rem 0 0; font-size: 0.36rem; font-stretch: normal; line-height: 0.98rem; box-sizing: border-box; padding-top: 0.2rem; padding-left: 0.32rem; letter-spacing: 0rem; color: #191f25; } .cancel-multiple-choice { .multiple-choice-list { width: 100%; height: 0.88rem; display: flex; // justify-content: center; align-items: center; position: relative; background-color: #ffffff; } .multiple-choice-img { width: 0.44rem; height: 0.44rem; margin-left: 0.24rem; margin-right: 0.4rem; } .multiple-choice-text { } .multiple-choice-line { position: absolute; height: 0.02rem; top: 0; left: 0.88rem; right: 0; background-color: #ededee; } } } } </style> <template> <div class="CancelOrderCause-layout"> <div class="cancel-list"> <h1 class="cancel-title">取消订单原因(必选)</h1> <div class="cancel-multiple-choice" v-for="(item, index) in arr" :key="index" > <div class="multiple-choice-list" @click="MultipleChoice(item, index)"> <img :src="selects === index ? activeIcon : inactiveIcon" alt="" class="multiple-choice-img"/> <span class="multiple-choice-text">选择{{ item }}</span> <div class="multiple-choice-line"></div> </div> </div> </div> </div> </template> <script> export default { name: 'Cance', data () { return { arr: [11, 22, 33, 44, 55, 66], activeIcon: '//image.greenplayer.cn/share/img/baoxian/icon_checked.svg', inactiveIcon: '//image.greenplayer.cn/share/img/baoxian/icon_unchecked.svg', selects: 100 } }, mounted () { document.title = '取消原因' }, methods: { MultipleChoice (item, index) { this.selects = index } } } </script>

最后

以上就是慈祥钻石最近收集整理的关于单选框_vue实现单选框自定义样式的全部内容,更多相关单选框_vue实现单选框自定义样式内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部