vue 组件内引入外部在线jscss

Posted linjiangxian

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue 组件内引入外部在线jscss相关的知识,希望对你有一定的参考价值。

参考:https://blog.csdn.net/u010881899/article/details/80895661

例:引入element-ui

js:

mounted() 
    const oScript = document.createElement(‘script‘);
    oScript.type = ‘text/javascript;
    oScript.src = ‘https://unpkg.com/element-ui@2.3.7/lib/index.js‘;
    document.body.appendChild(oScript);

css:

<style scoped>
    @import ‘https://unpkg.com/element-ui@2.3.7/lib/theme-chalk/index.css‘;
</style>

 

以上是关于vue 组件内引入外部在线jscss的主要内容,如果未能解决你的问题,请参考以下文章