element-ui select get selected option object
element-ui select get selected option object
value-key="value"
=== String ✅
:value="{value, label, token, trueValue, packageId}"
=== Object ✅
v-model="value"
=== Object ✅
<template>
<div class="token-select-box">
<el-select
popper-class="token-select-option-box"
v-model="value"
@change="selectHandler"
:filterable="searchable"
:clearable="clearable"
value-key="value"
:placeholder="placeholder">
<el-option
class="token-select-option"
v-for="({
value,
label,
token,
trueValue,
packageId,
}, index) in options"
:key="index"
:label="label"
:value="{value, label, token, trueValue, packageId}">
<span class="left">{{label}}</span>
<span v-if="token !== undefined" class="right">{{token}}</span>
</el-option>
</el-select>
<!-- <el-select
popper-class="token-select-option-box"
v-model="value"
@change="selectHandler"
:filterable="searchable"
:clearable="clearable"
:placeholder="placeholder">
<el-option
class="token-select-option"
v-for="({
value,
label,
token,
}, index) in options"
:key="index"
:label="label"
:value="value">
<span class="left">{{label}}</span>
<span v-if="token !== undefined" class="right">{{token}}</span>
</el-option>
</el-select> -->
</div>
</template>
https://element.eleme.io/#/zh-CN/component/select
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/14361466.html
未经授权禁止转载,违者必究!