Element UI version
2.12.0
OS/Browsers version
windows
Vue version
2.6.10
Reproduction Link
https://codepen.io/xyangxx/pen/zYYBqzx?editors=1011
Steps to reproduce
el-select在多选的情况下以选择一个显示label名称,但在远程搜索的一个关键字(不存在之前搜索的列表中)并选择之后,之前选址的label名称会被替换成绑定的value值
1、在重现链接的select里面输入关键字:例如 c,然后选择
2、在输入关键字:例如b,并选择
3、会发现之前搜c的选中的label值会变成绑定的value值
What is Expected?
不论我搜什么 我在select上面显示的label需要正确,是我绑定的label的值,而不是value的值
What is actually happening?
在select上面显示的是我绑定的value值
5条答案
按热度按时间drkbr07n1#
Translation of this issue:
Element UI version
2.12.0
OS / browsers version
Windows
Vue version
2.6.10
Reproduction link
HTTPS: / / codepen. IO / xyangxx / pen / zyybqzx? Editors = 1011
Steps to reproduce
El select in the case of multiple selections to select a display label name, but after selecting a keyword of remote search (not in the list of previous searches) and selecting it, the label name of the previous location will be replaced with the bound value value value.
###What is expected?
No matter what I search, the label displayed on select needs to be correct. It is the value of the label I bind, not the value.
###What is actually happening?
The value value of my binding is displayed on select.
1szpjjfi2#
这个我也遇到了,目前我的解决方案是,将之前的选项
push
到新options
中jaql4c8m3#
1.建议将版本降低到2.10.0,
11版本以上为了防止内存泄漏修改了代码https://github.com/ElemeFE/element/pull/16463/files#diff-714bc47586c25909dcdad45d530b51e2
2.也可以将代码这样写 https://codepen.io/0undefined0/pen/jOOZVvp?editors=1011
rqenqsqc4#
Duplicate of #17327
7bsow1i65#
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.