radio.vue
1.25 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
<template>
<div>
<Radio v-model="single" @on-change="c">Radio</Radio>
<Radio-group v-model="phone" type="button" @on-change="c">
<Radio label="apple">
<Icon type="social-apple"></Icon>
<span>Apple</span>
</Radio>
<Radio label="android">
<Icon type="social-android"></Icon>
<span>Android</span>
</Radio>
<Radio label="windows">
<Icon type="social-windows"></Icon>
<span>Windows</span>
</Radio>
</Radio-group>
<Radio-group v-model="animal">
<Radio label="金斑蝶"></Radio>
<Radio label="爪哇犀牛"></Radio>
<Radio label="印度黑羚"></Radio>
</Radio-group>
{{ phone }}
<div @click="phone = 'apple'">apple</div>
<div @click="single = true"> single</div>{{ single }}
</div>
</template>
<script>
export default {
data () {
return {
phone: 'apple',
animal: '爪哇犀牛',
single: false
}
},
methods: {
c (data) {
console.log(data)
}
}
}
</script>