update Radio

This commit is contained in:
梁灏 2017-04-27 18:04:51 +08:00
parent f89dd9c287
commit bb1f58e203
2 changed files with 11 additions and 5 deletions

View file

@ -1,8 +1,10 @@
<template> <template>
<div> <div>
<Radio-group v-model="date.sex"> <Radio-group v-model="date.sex">
<Radio label="male form"></Radio> <div v-if="show">
<Radio label="male"></Radio>
<Radio label="female"></Radio> <Radio label="female"></Radio>
</div>
</Radio-group> </Radio-group>
<Button @click="handleChange">change</Button> <Button @click="handleChange">change</Button>
</div> </div>
@ -12,13 +14,15 @@
data () { data () {
return { return {
date: { date: {
sex: '' sex: 'male'
} },
show: false
} }
}, },
methods: { methods: {
handleChange () { handleChange () {
this.date.sex = 'male form'; // this.date.sex = 'male form';
this.show = true;
} }
} }
} }

View file

@ -71,6 +71,8 @@
if (this.parent) this.group = true; if (this.parent) this.group = true;
if (!this.group) { if (!this.group) {
this.updateValue(); this.updateValue();
} else {
this.parent.updateValue();
} }
}, },
methods: { methods: {