<el-select ref = "selectInput" v-bind:disabled = "searchAddressResult.length==0" v-model = "selectAddress.netAddress"
value-key = "id" @change = "handelSelectAddresslActive" placeholder = "请选择局向地址" automatic-dropdown >
<el-option v -for = "item in searchAddressResult" :key = "item.id" :label = "item.netAddress" :value = "item" > < /el-option>
</el-select>在下拉框中绑定一个ref的名字,加上automatic-dropdown这个属性,然后在请求下拉框数据成功之后,写下面的代码
setTimeout(() = >{
that.$refs.selectInput.focus();
},
100);