Vue assembly is introduced into an external line js, css

Reference: https://blog.csdn.net/u010881899/article/details/80895661

Example: the introduction of element-ui

js:

mounted() {
    const oScript = document.createElement('script');
    oScript.type = 'text/javascript';
    oScript.src = 'https://unpkg.com/[email protected]/lib/index.js';
    document.body.appendChild(oScript);
}

css:

<style scoped>
    @import 'https://unpkg.com/[email protected]/lib/theme-chalk/index.css';
</style>

 

Guess you like

Origin www.cnblogs.com/linjiangxian/p/11460851.html