-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathel-radio.js
47 lines (47 loc) · 1.06 KB
/
el-radio.js
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
<template>
<div>
<el-radio-group>
<el-radio-button v-for="attr in attrOptions" :key="attr.id" :label="attr.id">{{attr.name}}
</el-radio-button>
</el-radio-group>
</div>
</template>
<script>
export default {
name: 'test',
data() {
return {
attrOptions: []
};
},
created() {
this.getApiData();
},
methods: {
// ajax get
getApiData() {
let me = this;
setTimeout(function() {
me.attrOptions = [
{
id: 1,
name: '北京'
},
{
id: 2,
name: '上海'
},
{
id: 3,
name: '广州'
},
{
id: 4,
name: '武汉'
}
];
}, 500);
}
}
};
</script>