vue 中contenteditable="true"添加可编辑属性后v-model双向绑定失效的解决办法

在项目中会遇到需要编辑单元格的双向绑定问题,v-model双向绑定会在添加contenteditable="true"属性后失效
解决方法如下,亲测好用(v-html和@blur实现):
<td class="width90" contenteditable="true" v-html="name3.LastProduct" @blur="name3.LastProduct=$event.target.innerText"></td>

完美好用!

猜你喜欢

转载自www.cnblogs.com/zhoushuang0426/p/11422421.html