我正在嘗試將 Element UI 的 Select 與整個(gè)對(duì)象一起用作值。正如您在我的示例中看到的,所選值正在更改,但當(dāng)前值的標(biāo)簽沒(méi)有。我不知道為什么。此外,選擇選項(xiàng)中的所有標(biāo)簽都是粗體,但應(yīng)該只選擇一個(gè)。腳本:data() { return { options: [ { id: 1, type: 'USER', age: 15 }, { id: 2, type: 'ADMIN', age: 22 } ], value: null }}模板: <el-select v-model="value" placeholder="Select"> <el-option v-for="item in options" :key="item.id" :label="item.type" :value="item"> </el-option> </el-select>演示: https://codepen.io/peter-peter-the-typescripter/pen/qBNeKEp
元素 UI 選擇不適用于對(duì)象作為值
桃花長(zhǎng)相依
2023-06-15 17:08:01