Skip to content

Sunday9787/load-script

Repository files navigation

@sunday9787/load-script

异步加载script

Install

Using npm:

npm install @sunday9787/load-script --save

or using yarn:

yarn add @sunday9787/load-script --dev

example

var loadScript = new LoadScript()
loadScript.load('./js/moduleA.js').then(() => {
  fnA('A js 已加载完毕')
})

loadScript.load('./js/moduleB.js').then(() => {
  fnA('B js 已加载完毕')
})