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
上?失?后手??置上?失?的status后,hover的??出?代?
upload?件代?
< Upload listType = "picture-card" maxCount = { 1 } fileList = { fileList } onPreview = { handlePreview } onChange = { handleChange } > { fileList . length !== 1 && uploadButton } < / Upload >
tsx文件handleChange代?
const [fileList, setFileList] = useState<UploadFile[]>([]); const handleChange: UploadProps['onChange'] = async (info) => { setFileList(info.fileList); if (info.file.status === 'uploading') { return; } if (info.file.status === 'done') { const formData = new FormData(); formData.append('file', info.file.originFileObj as File); try { const res = await upload(formData); console.log(res); if (res.code === 1) { message.success('上?成功'); setImageUrl(res.data); } else { // ?置上?失?的?? // ?步更新???片 setFileList((prevFileList) => [ { ...prevFileList[0], status: 'error', // 上??? }, ]); } } catch (error) { // ?步更新???片 setFileList((prevFileList) => [ { ...prevFileList[0], status: 'error', // 上??? }, ]); } } };
hover后出???效果,不??是一串html代?
The text was updated successfully, but these errors were encountered:
No branches or pull requests