用于在同一文件包下封装组件方便
!(() => {
var getPath = function () {
var jsPath = document.currentScript ? document.currentScript.src : function(){
var js = document.scripts, last = js.length - 1, src;
for(var i = last; i > 0; i--){
if(js[i].readyState === 'interactive'){
src = js[i].src;
break;
}
}
return src || js[last].src;
}();
return jsPath.substring(0, jsPath.lastIndexOf('/') + 1);
}()
const link = document.createElement('link')
link.href = `${getPath}index.css`
link.rel = 'stylesheet'
document.head.appendChild(link)
})()
网友评论