fix: 修复 inputImage 裁剪模式配置文件大小限制报错问题 #7055
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
🤖 Generated by Copilot at 25066c4
This pull request enhances the
input-image
component to support file size limits, cropping, and better error handling. It also updates the Chinese documentation and adds a new translation key for the cropped image label.🤖 Generated by Copilot at 25066c4
Why
How
🤖 Generated by Copilot at 25066c4
File.imageAfterCrop
to the locale files for German, English, and Chinese, with the corresponding values for cropped image. (link, link, link)限制文件大小
to限制文件宽度
, and adding a new section限制文件大小
with an example schema. (docs/zh-CN/components/form/input-image.md
, link, link)handleDrop
method of the input-image component, to alert the user with error messages if the drop event contains an array of errors instead of files. This handles the case when the user tries to drop an invalid file type or size. (packages/amis/src/renderers/Form/InputImage.tsx
, link)handleDrop
method of the input-image component, to use the translation keyFile.imageAfterCrop
as the file name if the file name is undefined. This handles the case when the user crops an image and drops it to the input-image component, which does not have a file name by default. (packages/amis/src/renderers/Form/InputImage.tsx
, link)