@monkeycf/dynamic-script
v1.1.0
Published
dynamic loading JavaScript
Downloads
2
Readme
@monkey/dynamic-script
dynamic loading JavaScript
example
import dynamicScript from '@monkeycf/dynamic-script'
dynamicScript('${your script url}')
.then(({element, event}) => {
// to do something
})
.catch(({element, event}) => {
// processing error
})
如果想使用“事件捕获”,可设置 isCapturing 为 true
dynamicScript('${your script url}', true)
.then(({element, event}) => {
// to do something
})
.catch(({element, event}) => {
// processing error
})