We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
ProFormUploadButton组件中当fieldProps.listType设为picture-card时,预览失效
同antd的Image组件自带的预览效果
<ProFormUploadButton max={1} label="小图" name="icon" accept=".jpg,.png,.jpeg" extra={uploadImage} action={getUrl() + '/upload?type=image'} fieldProps={{ method: 'POST', name: 'file', listType: 'picture-card', accept: '.png, .jpg, .jepg', headers: { 'x-auth-token': localStorage.getItem('token') || '', }, }} onChange={(e) => { if (e.file.status == 'removed') { setUploadImage(''); } else if (e.file.status == 'done') { if (e.file.response.code == 200) { setUploadImage(e.file.response.data.imgUrl); } else { message.error(e.file.response.msg); } } }} />
"@ant-design/pro-components": "^2.6.48", "@umijs/route-utils": "^2.2.2",
The text was updated successfully, but these errors were encountered:
No branches or pull requests
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
ProFormUploadButton组件中当fieldProps.listType设为picture-card时,预览失效
📷 复现步骤
🏞 期望结果
同antd的Image组件自带的预览效果
💻 复现代码
<ProFormUploadButton
max={1}
label="小图"
name="icon"
accept=".jpg,.png,.jpeg"
extra={uploadImage}
action={getUrl() + '/upload?type=image'}
fieldProps={{
method: 'POST',
name: 'file',
listType: 'picture-card',
accept: '.png, .jpg, .jepg',
headers: {
'x-auth-token': localStorage.getItem('token') || '',
},
}}
onChange={(e) => {
if (e.file.status == 'removed') {
setUploadImage('');
} else if (e.file.status == 'done') {
if (e.file.response.code == 200) {
setUploadImage(e.file.response.data.imgUrl);
} else {
message.error(e.file.response.msg);
}
}
}}
/>
© 版本信息
"@ant-design/pro-components": "^2.6.48",
"@umijs/route-utils": "^2.2.2",
🚑 其他信息
The text was updated successfully, but these errors were encountered: