ElemeFE / ElemeFE/element

[bug report] when the data bound by El select v-mode is different from the data in the El options list, select the last item in the list to be selected twice

Open
#20,583 2 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Element UI version
2.13.2

### OS/Browsers version
win10 x64 版本号:20H2, 操作系统版本:19042.685

### Vue version
2.6.10

### Reproduction Link
https://elementui.github.io/

### Steps to reproduce
先吐槽一下,话说提bug的时候,要重现链接必填,是不想让人提bug吗?
项目在开发中,还没有上线,没有重现链接

在编辑记录场景下,用el-select 多选,v-mode 绑定原有的选中记录(数组,2个元素),el-option 待选择列表里面的值,和原有的值不匹配, 此时会报把待选择列表当中的最后一项,选中2次
我觉得这是个bug

以下是代码解释, 这个很好测试,你们直接 生成两个数据结构完全相同,但是数据完全不相同的数组 试一下就知道了

formItems.resourcesProject.projectList和projectList 数据【结构】完全相同,但是数据完全不相同,最终会把 projectList里面的最后一项值,选择2次,这是个bug








![image](https://user-images.githubusercontent.com/1888094/102502893-1f68f900-40ba-11eb-9fd5-e2464365ffbf.png)

### What is Expected?
在编辑场景下,原有的选中的值和待选择列表 没有匹配到的话,不显示才对

### What is actually happening?
在编辑场景下,原有的选中的值和待选择列表 两个【数据结构】【完全相同】, 数据完全【不相同】, 会把待选择列表当中的最后项选了两次,这导致报:重复的key这样的错,
“[Vue warn]: Duplicate keys detected: '1001'. This may cause an update error.”

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.