Commit bb1f58e20305f28166cdc401951061d15dd57466

Authored by 梁灏
1 parent f89dd9c2

update Radio

examples/routers/radio.vue
1 1 <template>
2 2 <div>
3 3 <Radio-group v-model="date.sex">
4   - <Radio label="male form"></Radio>
5   - <Radio label="female"></Radio>
  4 + <div v-if="show">
  5 + <Radio label="male"></Radio>
  6 + <Radio label="female"></Radio>
  7 + </div>
6 8 </Radio-group>
7 9 <Button @click="handleChange">change</Button>
8 10 </div>
... ... @@ -12,13 +14,15 @@
12 14 data () {
13 15 return {
14 16 date: {
15   - sex: ''
16   - }
  17 + sex: 'male'
  18 + },
  19 + show: false
17 20 }
18 21 },
19 22 methods: {
20 23 handleChange () {
21   - this.date.sex = 'male form';
  24 +// this.date.sex = 'male form';
  25 + this.show = true;
22 26 }
23 27 }
24 28 }
... ...
src/components/radio/radio.vue
... ... @@ -71,6 +71,8 @@
71 71 if (this.parent) this.group = true;
72 72 if (!this.group) {
73 73 this.updateValue();
  74 + } else {
  75 + this.parent.updateValue();
74 76 }
75 77 },
76 78 methods: {
... ...