如何动态创建el-select 且动态绑定值
let newRow = document.createElement("p");
newRow.style = 'width:100%;height:30px'
if (this.count < 5) {
newRow.innerHTML = `
<el-select v-model="value_ywj" placeholder="请选择">`+ `
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">`+ `
</el-option>`+ `
</el-select>`+ `
<el-input v-model="value2" clearable> </el-input>`+`
<span style="color:blue;cursor: pointer;">删除</span>
`
this.$refs.ywjEvents.insertBefore(newRow, this.$refs.addBtn);
el-select 和 el-input 无法显示
我想实现动态创建一个p标签,里面包括下拉菜单和input框,且要动态绑定值,对他进行操作,但是创建出的p标签 里下拉菜单和input无法显示
显示 下拉菜单和input框,且要动态绑定值
vue 里 就可以 用 v-for实现 。 不用字符串拼接