Issue #53: done.

This commit is contained in:
chiayin
2023-09-14 21:01:09 +08:00
parent 47ca3d8f21
commit c00123ddcb
5 changed files with 263 additions and 52 deletions

View File

@@ -14,14 +14,21 @@
</template>
<script>
export default {
props: ['title', 'select', 'data', 'category'],
props: ['title', 'select', 'data', 'category', 'task', 'isSubmit'],
data() {
return {
selectedRadio: this.select,
localSelect: null,
selectedRadio: null,
}
},
watch: {
task: function(newValue) {
this.selectedRadio = newValue;
}
},
methods: {
actRadioData() {
this.localSelect = null;
this.$emitter.emit('actRadioData', {
category: this.category,
task: this.selectedRadio,
@@ -30,6 +37,8 @@ export default {
}
},
created() {
this.localSelect = this.isSubmit ? this.select : null;
this.selectedRadio = this.localSelect;
this.$emitter.on('reset', (data) => {
this.selectedRadio = data;
});