radio.vue
1.03 KB
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
<template>
<div>
<Radio :checked.sync="radio">梁灏</Radio>
{{ radio | json }}
<div @click="radio = false">单项切换</div>
<br><br><br>
<Radio-group :model.sync="radioGroup" size="large" type="button" @on-change="changeGroup">
<Radio value="梁灏"></Radio>
<Radio value="段模"></Radio>
<Radio value="倪斌"></Radio>
</Radio-group>
{{ radioGroup | json }}
<div @click="radioGroup = '梁灏'">多项切换</div>
</div>
</template>
<script>
import { Radio } from 'iview';
const RadioGroup = Radio.Group;
export default {
components: {
Radio,
RadioGroup
},
props: {
},
data () {
return {
radio: true,
radioGroup: '段模'
}
},
computed: {
},
methods: {
changeGroup (data) {
console.log(data);
}
}
}
</script>