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

[question]Uploader文件上传组件,完成某些操作后怎么清空显示的已上传的文件 #1597

Closed
xiaohz22 opened this issue Aug 25, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@xiaohz22
Copy link

你想知道什么?

你好,我想知道Uploader文件上传组件可以清空显示的已上传的文件吗?

image

如图,我上传了一张图片,按提交按钮后进行了某些操作,这些操作结束需要清除红框中显示的图片

描述你考虑过的替代方案

尝试通过绑定v-model:file-list属性,直接赋值空数组但未能解决。

其它

请问有什么解决方案吗?

@xiaohz22 xiaohz22 added the question Further information is requested label Aug 25, 2022
@richard1015 richard1015 self-assigned this Sep 14, 2022
@richard1015
Copy link
Member

   const defaultFileList = reactive([
      {
        name: 'file 1.png',
        url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif',
        status: 'success',
        message: translate('success'),
        type: 'image'
      },
      {
        name: 'file 2.png',
        url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif',
        status: 'error',
        message: translate('error'),
        type: 'image'
      },
      {
        name: 'file 3.png',
        url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif',
        status: 'uploading',
        message: translate('uploading'),
        type: 'image'
      }
    ]);

    setTimeout(() => {
      defaultFileList.splice(0,defaultFileList.length)
    }, 3000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants