深层次的嵌套有时候会导致el-input明明输入了数据,但是视图却没有刷新,但是console.log打印的值却是正常的
解决方法:
<el-input v-model="item1.title" @input="wallpaperInput" />
增加@input事件,每次输入的时候触发方法
method :
wallpaperInput() {
this.$forceUpdate()
}
每次输入调用 this.$forceUpdate() 刷新视图
问题轻松解决,没有那么多花里胡哨的代码,实用