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

iview Upload组件,自定义onSuccess、onRemove方法修改了传给表单的value,会导致无法预览以及移除已上传文件 #562

Open
nicholasfung68 opened this issue Dec 6, 2022 · 2 comments

Comments

@nicholasfung68
Copy link

onSuccess传递的函数
image
image

iview 自定义onSuccess、onRemove方法修改了传给表单的value,会导致无法预览以及移除已上传文件
image

image

image
image

不论用户自定义onSuccess、onRemove函数里修改了self对象自己的value与否,以上传文件应该都可以正常响应预览以及移除文件事件。

建议修改 parseFile 方法,将文件的 status 属性存放进去。

@xaboy
Copy link
Owner

xaboy commented Dec 11, 2022

在 onSuccess里面 fileName 直接赋值就 file.url 就会自动修改value, 当前可以先在事件中修改 value 时加点延迟,保证功能正常.

@nicholasfung68
Copy link
Author

在 onSuccess里面 fileName 直接赋值就 file.url 就会自动修改value, 当前可以先在事件中修改 value 时加点延迟,保证功能正常.

目前就是这么干的——在nextTick中操作Upload的fileList,加上了status属性……

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

No branches or pull requests

2 participants