<template>
<el-select
v-model="addForm.id"
clearable
@change="queryName"
>
<el-option
v-for="item in anchorOption"
:key="item .id"
:label="item .name"
:value="item .id"/>
</el-select>
</template>
<script>
export default {
data() {
return {
anchorOption:[],
addForm: {}
},
}
methods:{
queryName(e){
let arr= this.anchorOption.filter((item)=>{
return item.id=== e
});
this.addForm.name= arr[0].name
},
}
</script>