form-create
form-create copied to clipboard
upload 上传文件内容 怎么不在表单中,我的场景是autoUpload: false 最终提交上传
这个内置的 upload 组件不支持, 建议通过自定义组件实现
@xaboy 您好,自定义组件 httpRequest 这个事件无法触发
formCreate.component('msUpload', { render($h) { return $h('ElUpload', { props: { action: "", uploadType: "file", showFileList: true, autoUpload: false, fileList: this.fileList, httpRequest: this.onClick, limit: 2 }, on: { httpRequest: () => { this.onClick() } } }, ['点击上传']) }, data: function () { return { fileList: [{name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg'}] } }, props: {}, methods: { onClick: function (file) { console.log(file) if(file) { this.fileList.push(file); } }, }, })