Commit 1f5ebbda authored by daywrite's avatar daywrite

修复singleRadio使用watch

parent fd420726
export default { export default {
data () { data () {
return { return {
item: '',
timeItem: '', timeItem: '',
inputSelectItem: 'rmb' inputSelectItem: 'rmb'
} }
}, },
computed: { // computed: {
item: { // item: {
get () { // set (val) {
return this.formItem // this.$emit('update:item', val)
}, // }
// }
set (val) { // },
this.$emit('update:item', val)
}
}
},
props: { props: {
formItem: [Number, String], formItem: [Number, String],
...@@ -61,12 +58,21 @@ export default { ...@@ -61,12 +58,21 @@ export default {
} }
}, },
watch: { watch: {
'formItem': {
handler (val) {
this.item = val
},
immediate: true
},
'formTimeItem' (val) { 'formTimeItem' (val) {
this.timeItem = val this.timeItem = val
}, },
'formInputSelect' (val) { 'formInputSelect' (val) {
this.inputSelectItem = val this.inputSelectItem = val
}, },
'item' (val) {
this.$emit('update:item', val)
},
'timeItem' (val) { 'timeItem' (val) {
this.$emit('update:item', val) this.$emit('update:item', val)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment