我是靠谱客的博主 背后芒果,这篇文章主要介绍全网最简单,没有之一,自定义单选框(Vue),现在分享给大家,希望可以做个参考。

废话不多说直接上代码:

复制代码
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
<template> <div class="flex"> <div class="flex" v-for="(item,index) in radio" :key="index" @click="heightliang(index)"> <div class="radio"> <span :class="{radiosmall:index==isactive}"></span> </div> <p>{{item}}</p> </div> </div> </template> <style scoped> .flex{ display: flex; align-items: center; } .radio{ width: 8px; height: 8px; border-radius:50%; border:1px solid #ffa126; display: flex; justify-content: center; align-items: center; } .radiosmall{ width: 6px; height: 6px; background-color: #ffa126; border-radius: 50%; } </style> <script> export default { data() { return { radio:["你好","hello","私密马赛"], isactive:0 } }, methods:{ heightliang(e){ this.isactive = e } } } </script>

最后

以上就是背后芒果最近收集整理的关于全网最简单,没有之一,自定义单选框(Vue)的全部内容,更多相关全网最简单内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部