Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Component] el-upload的fileList api,不用v-model,直接:fileList绑定,也会篡改父组件绑定的数据 #16712

Open
Qzhor opened this issue Apr 29, 2024 · 0 comments · May be fixed by #16715

Comments

@Qzhor
Copy link

Qzhor commented Apr 29, 2024

Element Plus version

2.7.2

OS/Browsers version

macOS 13.6 / 124.0.6367.93(正式版本) (arm64)

Vue version

3.5.0-alpha.1

Reproduction Link

https://github.com/element-plus/element-plus/issues

Steps to reproduce

element-plus官网upload组件示例第一个例子,把绑定的v-model:file-list="fileList"改为:file-list="fileList",
两张图片,删除一张,会直接篡改当前组件的fileList的值

What is Expected?

没有使用v-model来进行绑定的时候,不应该直接篡改调用方(el-upload组件的地方)绑定的fileList的值

What is actually happening?

el-upload内部的uploadFiles定义时,调用useVModel时第四个参数option里应当传递clone:true,deep:true

@Qzhor Qzhor changed the title [Bug Report] el-upload的fileList api,不用v-model,直接:fileList绑定,也会篡改父组件绑定的数据 [Component] el-upload的fileList api,不用v-model,直接:fileList绑定,也会篡改父组件绑定的数据 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant