Skip to content

[Feature Request]Upload组件 支持覆盖默认的上传行为 #1100

New issue

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

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

Already on GitHub? # to your account

Open
ZhaoQi99 opened this issue Oct 11, 2022 · 0 comments · May be fixed by #1102
Open

[Feature Request]Upload组件 支持覆盖默认的上传行为 #1100

ZhaoQi99 opened this issue Oct 11, 2022 · 0 comments · May be fixed by #1102

Comments

@ZhaoQi99
Copy link

What problem does this feature solve?

覆盖默认的上传行为,可以自定义上传的实现

What does the proposed API look like?

https://element.eleme.cn/#/zh-CN/component/upload
参见http-request

<template>
    <Upload action="" :http-request="upload">
        <Button icon="ios-cloud-upload-outline">Upload files</Button>
    </Upload>
</template>
<script>
export default {
  data() {
    return {};
  },

  methods: {
    upload({ file }) {
      let form = new FormData()
      form.append('file', file)
      return uploadFile(form)
    }
  }
};
</script>
@ZhaoQi99 ZhaoQi99 linked a pull request Oct 11, 2022 that will close this issue
ZhaoQi99 added a commit to ZhaoQi99/ViewUI that referenced this issue Oct 11, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant