赞
踩
- <a-upload v-model:file-list="fileList" name="file" :showUploadList="false"
- :customRequest="e => customRequest(e, path)">
- <a-button type="primary" size="middle">
- <cloud-upload-outlined />上传
- </a-button>
- </a-upload>
- customRequest(options, path) {
- let formData = new FormData();
- formData.append("file", options.file);
- reqFileUpload(path, formData).then(response => {
- if (response.code == 0) {
- options.onSuccess(response, options.file);
- message.success('上传成功!');
- this.getFileList()
- } else {
- message.error(response.msg);
- }
- })
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。