diff --git a/examples/routers/radio.vue b/examples/routers/radio.vue index 41b72c4..53df9a4 100644 --- a/examples/routers/radio.vue +++ b/examples/routers/radio.vue @@ -1,8 +1,10 @@ <template> <div> <Radio-group v-model="date.sex"> - <Radio label="male form"></Radio> - <Radio label="female"></Radio> + <div v-if="show"> + <Radio label="male"></Radio> + <Radio label="female"></Radio> + </div> </Radio-group> <Button @click="handleChange">change</Button> </div> @@ -12,13 +14,15 @@ data () { return { date: { - sex: '' - } + sex: 'male' + }, + show: false } }, methods: { handleChange () { - this.date.sex = 'male form'; +// this.date.sex = 'male form'; + this.show = true; } } } diff --git a/src/components/radio/radio.vue b/src/components/radio/radio.vue index 3726162..d7513da 100644 --- a/src/components/radio/radio.vue +++ b/src/components/radio/radio.vue @@ -71,6 +71,8 @@ if (this.parent) this.group = true; if (!this.group) { this.updateValue(); + } else { + this.parent.updateValue(); } }, methods: { -- libgit2 0.21.4