This commit is contained in:
xaoxuu 2021-06-26 23:37:30 +08:00
parent 38263f19c8
commit c67065b011
1 changed files with 2 additions and 7 deletions

View File

@ -61,13 +61,8 @@
// 从 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
var script = document.createElement('script');
script.src = src;
if (opt) {
for (let key of Object.keys(opt)) {
script[key] = opt[key]