技术笔记
js触发vue v-model数据双向绑定
 moons   2020-09-03 17:10:24   228
专栏分类: javascript
#Html
<input v-bind:id="'skuimg_'+(key+1)"  value="" v-model="sites[key].skuimg">
#js
$('#skuimg_'+kid).val(id);

#触发更新input值   
document.getElementById('skuimg_'+kid).dispatchEvent(new Event('input'));

# 触发更新input
document.getElementById('skuimg_'+kid).dispatchEvent(new Event('change'));
Copyright © mos360.cn By Moons Soft Studio 百度统计