修复懒加载标签重复的问题

This commit is contained in:
xaoxuu 2021-06-23 16:54:35 +08:00
parent 50b890c396
commit 1c466465de
1 changed files with 5 additions and 0 deletions

View File

@ -61,6 +61,11 @@
// 从 butterfly 和 volantis 获得灵感
loadScript: (src, opt) => new Promise((resolve, reject) => {
// 判断是否存在
let el = document.querySelector("script[src='" + src + "']")
if (el !== null) {
return
}
var script = document.createElement('script')
script.src = src
if (opt) {