qrcode 改为cdn

This commit is contained in:
tangly1024
2023-07-31 21:30:38 +08:00
parent b7c84d5218
commit 187b173ead
7 changed files with 50 additions and 7 deletions

View File

@@ -39,8 +39,14 @@ export function loadExternalResource(url, type) {
tag.src = url
}
if (tag) {
tag.onload = () => resolve(url)
tag.onerror = () => reject(url)
tag.onload = () => {
console.log(url, '加载成功')
resolve(url)
}
tag.onerror = () => {
console.log(url, '加载失败')
reject(url)
}
document.head.appendChild(tag)
}
})