<el-select
v-model="item.couponRandomId"
filterable
:id="`searchSelect${index}`"
remote
reserve-keyword
placeholder="请输入"
ref="searchSelect"
:class="{ coupon: !item.couponRandomId }"
:remote-method="remoteMethod"
:loading="loading"
style="width: 230px"
>
<el-option
v-for="item in options"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
methods中
watch: {
"editForms.list": function () {
this.$nextTick(() => {
this.addDom();
});
},
},
addDom() {
this.editForms.list.forEach((item, index) => {
let input = document.querySelector(`#searchSelect${index}`);
if (input) {
input.setAttribute("maxLength", 8);
}
});
},