我正在尝试发出我修改过的道具。我可以直接用道具来做到这一点,并且可以正常工作,但是我收到了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); } }
添加回答
举报
0/150
提交
取消