Element UI version
2.13.2
OS/Browsers version
win7,chrome
Vue version
3.0.0-beta.14
Reproduction Link
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
4条答案
按热度按时间uqzxnwby1#
Translation of this issue:
Element UI version
2.13.2
OS/Browsers version
win7,chrome
Vue version
3.0.0-beta.14
Reproduction Link
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
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?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.
kmb7vmvb4#
没人关注这个问题吗