element How to get the label value of the currently selected El option ,@change The event object only returns value. I need to get the value of both lab and value

zzoitvuj  于 8个月前  发布在  其他
关注(0)|答案(4)|浏览(224)

Element UI version

2.13.2

OS/Browsers version

win7,chrome

Vue version

3.0.0-beta.14

https://codepen.io/pen

Steps to reproduce

select选中后,返回label和value的值, elementUI默认只返回类value

What is Expected?

select选中后,返回label和value的值, elementUI默认只返回类value

What is actually happening?

select选中后,返回label和value的值, elementUI默认只返回类value

uqzxnwby

uqzxnwby1#

Translation of this issue:

Element UI version

2.13.2

OS/Browsers version

win7,chrome

Vue version

3.0.0-beta.14

https://codepen.io/pen

Steps to reproduce

When select is selected, the values of label and value are returned. By default, the elementui only returns the class value

What is Expected?

When select is selected, the values of label and value are returned. By default, the elementui only returns the class value

What is actually happening?

When select is selected, the values of label and value are returned. By default, the elementui only returns the class value

展开查看全部
ycggw6v2

ycggw6v22#

When will this requirement be fulfilled? At the current conditions,for the below code:
<el-option v-for="item in list" :key="item.id" :label="item.name" :value="item.id"> </el-option>
When the change event triggered, if you want to get a value of item, you can only find and traverse the list to get it. I don’t think it is very suitable, because the option has already used the v-for loop. If you want to get the relate object according to the selected item, you have to traverse the list again, Isn't it unreasonable?

mm5n2pyu

mm5n2pyu3#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kmb7vmvb

kmb7vmvb4#

没人关注这个问题吗

相关问题