<el-select v-model="optForm.inoviceTitle" @change="changeInvoce">
<el-option
v-for="item in invoiceList"
:key="item.cid"
:label="item.inoviceTitle"
:value="item.cid">
</el-option>
</el-select>
changeInvoce(val){
console.log(val)//val为cid
let obj = {};
obj = this.invoiceList.find((item) => {
return item.cid === val;
});
console.log(obj)//obj为这一行的数据
}
vue中切换select时根据id,找到被选择行的数据
最新推荐文章于 2024-06-05 17:16:04 发布