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
export function loadImage(url) { return new Promise((resolve, reject) => { const image = new Image() image.onload = () => { resolve(image) } image.onerror = () => { reject(new Error('Image load error')) } image.crossOrigin = 'Anonymous' // 支持跨域图片 image.src = url }) }
2.图片的大小是否有限制,图片超过200kb,页面展示一直是img error,用不用懒加载都是一样
The text was updated successfully, but these errors were encountered:
No branches or pull requests
export function loadImage(url) {
return new Promise((resolve, reject) => {
const image = new Image()
image.onload = () => {
resolve(image)
}
image.onerror = () => {
reject(new Error('Image load error'))
}
image.crossOrigin = 'Anonymous' // 支持跨域图片
image.src = url
})
}
2.图片的大小是否有限制,图片超过200kb,页面展示一直是img error,用不用懒加载都是一样
The text was updated successfully, but these errors were encountered: