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
目前无法回显无后缀的图片,没有解决办法。查看源码,发现是这个方法,匹配得有点死了。
/** * 检查提供的URL是否为图片URL。 * @param url 待检查的URL字符串。 * @returns 返回一个布尔值,如果URL是图片格式,则为true;否则为false。 */ export function isImageUrl(url: string): boolean { // 使用正则表达式匹配图片URL const imageRegex = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|image)/i return imageRegex.test(url) }
或许可以增加一个字段比如 isImage,指定该文件为图片,就不走这个校验直接回显。
isImage
The text was updated successfully, but these errors were encountered:
No branches or pull requests
这个功能解决了什么问题?
目前无法回显无后缀的图片,没有解决办法。查看源码,发现是这个方法,匹配得有点死了。
你期望的 API 是什么样子的?
或许可以增加一个字段比如
isImage
,指定该文件为图片,就不走这个校验直接回显。The text was updated successfully, but these errors were encountered: