vue中v-for嵌套v-model
html部分<FormItem style="display:inline-block;" v-for="extendProp in extendPropList"><label style="font-weight:700;width: 70px; display:inline-block; text-align: right;">{{extendProp.na...
·
html部分
<FormItem style="display:inline-block;" v-for="extendProp in extendPropList">
<label style="font-weight:700;width: 70px; display:inline-block; text-align: right;">{{extendProp.name}}:</label>
<Input v-model="extendProp.value" style="width:250px;" placeholder= "请输入扩展信息" />
</FormItem>
js部分
//查询扩展信息属性
async selectExtend(value,selectedData){
this.extendPropList = [];
var assetsTypeName = selectedData[(selectedData.length)-1].label;
const{data:res} = await this.$http.get("/assets/information/search/all?assetsTypeName="+assetsTypeName);
//遍历放入data中定义的数组
for(var i in res){
this.extendPropList.push({name: res[i].name, value: ''});
}
},
更多推荐
已为社区贡献1条内容
所有评论(0)