可以将input 封装起来,将 v-model 绑定的值换成 computed 里面的一个变量,通过get去改变显示内容。 ... v-model="inputVal" ... props: ['value'], computed: { inputVal: { get() { // @todo 这里做修改 return this.value }, set(val) { this.$emit('input', val) }, }, }
阅读量:1
点赞量:0