Vue中动态渲染输入框并v-model绑定后无法输入
<el-inputv-model="data[item.prop]"></el-input>示例: data={size:''}config=[{label:'ceshi',prop:'size'}]item 为循环后的对象for (var i = 0; i < this.config.length; i++) {this.data[this.config[i]['p
·
<el-input v-model="data[item.prop]"></el-input>
示例: data={size:''}
config=[{label:'ceshi',prop:'size'}]
item 为循环后的对象
for (var i = 0; i < this.config.length; i++) {
this.data[this.config[i]['prop']] =''
}
//v-model 绑定后无法输入
for (var i = 0; i < this.config.length; i++) {
// this.data[this.config[i]['prop']] =''
this.$set(this.data, this.config[i]['prop'], '')
}
更多推荐
已为社区贡献9条内容
所有评论(0)