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
Describe the bug
使用 @formily/next 的 Upload 来上传图片,上传完后,组件预览的图片不是实际上传的图片。
@formily/next
上传的图片
预览的图片
To Reproduce
上传后返回或 format 后的结果中的 imgURL 是类似 //img.z-any.com/xx.png 的形式即可重现。
imgURL
//img.z-any.com/xx.png
原因是,总是使用 imgURL 去匹配内置的 icon,虽然 exclude 中默认包含了图片扩展名(如 .png),但由于正则没指定匹配到最后面,所以,前面的路径,虽然在 .png 哪条规则上跳过了,但却会命中 .z 这个正则。
.png
.z
Expected behavior
接口有提供预览图片时,使用提供的图片而非默认图片
Additional context
formily/packages/next-components/src/upload/index.tsx
Lines 96 to 103 in 498cb6f
Lines 61 to 64 in 498cb6f
The text was updated successfully, but these errors were encountered:
fix Upload preview image
b615f8f
Use provided image first, if not exist, then fallback to suggested icon. fix ext match pattern close alibaba#1030
fix Upload preview image (#1031)
e2bfcce
Use provided image first, if not exist, then fallback to suggested icon. fix ext match pattern close #1030
Successfully merging a pull request may close this issue.
Describe the bug
使用
@formily/next
的 Upload 来上传图片,上传完后,组件预览的图片不是实际上传的图片。上传的图片
预览的图片
To Reproduce
上传后返回或 format 后的结果中的
imgURL
是类似//img.z-any.com/xx.png
的形式即可重现。原因是,总是使用
imgURL
去匹配内置的 icon,虽然 exclude 中默认包含了图片扩展名(如.png
),但由于正则没指定匹配到最后面,所以,前面的路径,虽然在.png
哪条规则上跳过了,但却会命中.z
这个正则。Expected behavior
接口有提供预览图片时,使用提供的图片而非默认图片
Additional context
formily/packages/next-components/src/upload/index.tsx
Lines 96 to 103 in 498cb6f
formily/packages/next-components/src/upload/index.tsx
Lines 61 to 64 in 498cb6f
The text was updated successfully, but these errors were encountered: