-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
Radio.vue
54 lines (48 loc) · 1.26 KB
/
Radio.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
47
48
49
50
51
52
53
54
<template>
<div>
<group title="default">
<radio :options="radio001" @on-change="change"></radio>
</group>
<group title="preselect 'China'">
<radio :options="radio001" value="China"></radio>
</group>
<group :title="'fill mode value is '+radio001Value">
<radio fill-mode :options="radio001" :value.sync="radio001Value" @on-change="change"></radio>
</group>
<group title="fill mode with custom placeholder and label">
<radio fill-mode fill-label="Other" fill-placeholder="填写其他的哦" :options="radio001" @on-change="change"></radio>
</group>
<group title="object options">
<radio fill-mode fill-label="Other" fill-placeholder="other" :options="radio003" @on-change="change"></radio>
</group>
</div>
</template>
<script>
import { Radio, Group, DevTip } from '../components'
export default {
components: {
Radio,
Group,
DevTip
},
data () {
return {
radio001: [ 'China', 'Japan' ],
radio001Value: 'China',
radio002Value: 'Japan',
radio003: [{
key: '001',
value: 'radio001'
}, {
key: '002',
value: 'radio002'
}]
}
},
methods: {
change (value) {
console.log('change:', value)
}
}
}
</script>