<template>
<div>
<div>
<a-radio-group v-model="showA">
<a-radio :value="true" @change="showRadio(showA)">是</a-radio>
<a-radio :value="false" @change="showRadio(showA)">否</a-radio>
</a-radio-group>
<div v-show="showA">我是A的内容</div>
</div>
<div style="margin-top: 1rem;">
<a-radio-group v-model="showB">
<a-radio :value="true" @change="showRadio(showA)">是</a-radio>
<a-radio :value="false" @change="showRadio(showA)">否</a-radio>
</a-radio-group>
<div v-show="showB">我是B的内容</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
showA: true,
showB: false
}
},
methods: {
showRadio(a){
if(a != !a){
this.showA = !a
this.showB = a
}
}
}
}
</script>