我正在嘗試發出我修改過的道具。我可以直接用道具來做到這一點,并且可以正常工作,但是我收到了Vue警告:Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders因此,我嘗試將prop放入計算對象中,但是在執行計算對象之前執行發射。template: <input v-on:keyup="validatedate(localDate)" v-on:change="emitAnswer(localDate)" v-model="localDate"> , computed: { dateLocal: { get: function () { return this.date } } methods: { emitAnswer: function (date) { this.$emit('myFunc', date); } }
$ emit在計算之前執行
幕布斯6054654
2021-04-07 13:26:28