upload组件 props对象中的listType 默认为 picture-card,更改为text 后,上传成功后 fileList中不显示文件名
版本号 (version)
@form-create/ant-design-vue 3.x
问题描述 (Issue)
upload组件 props对象中的listType 默认为 picture-card,更改为text 后,上传成功后 fileList中不显示文件名

#复现步骤/生成规则 (Duplicate steps/generate rules) rule : { type: 'upload', title: field.fieldName, field: field.fieldCode, value: [], props: { limit: extJson.data || 1, type: extJson.controlType, listType: extJson.controlType === 'pic' ? 'picture-card' : 'text', headers: headers, accept: accept, action: sysConfig.API_URL + '/dev/file/uploadLocalReturnUrl', // 上传成功回调函数 onSuccess: function (file) { console.log(file) if (file.response.result) { file.url = file.response.result } } }, children: extJson.controlType === 'pic' ? [] : [{ type: 'a-button', props: { type: 'dashed', block: true }, children: ['点击上传'] }] }
期望的结果 (Desired outcome) listType:'text' 的时候 上传成功后显示的 列表 能够显示 文件名
感谢反馈,我这边检查一下
版本号 (version) @form-create/ant-design-vue 3.x问题描述 (Issue) upload组件 props对象中的listType 默认为 picture-card,更改为text 后,上传成功后 fileList中不显示文件名
#复现步骤/生成规则 (Duplicate steps/generate rules) rule : { type: 'upload', title: field.fieldName, field: field.fieldCode, value: [], props: { limit: extJson.data || 1, type: extJson.controlType, listType: extJson.controlType === 'pic' ? 'picture-card' : 'text', headers: headers, accept: accept, action: sysConfig.API_URL + '/dev/file/uploadLocalReturnUrl', // 上传成功回调函数 onSuccess: function (file) { console.log(file) if (file.response.result) { file.url = file.response.result } } }, children: extJson.controlType === 'pic' ? [] : [{ type: 'a-button', props: { type: 'dashed', block: true }, children: ['点击上传'] }] }
期望的结果 (Desired outcome) listType:'text' 的时候 上传成功后显示的 列表 能够显示 文件名
onSuccess 的第一个参数是response 吧。第二个参数才是file, 要把第二个参数的url设置为要展示的name。 http://www.form-create.com/v3/guide/component/upload.html
这个文件名回显还没解决啊