合作联系微信: w6668263      合作联系电话:177-9238-7426     

vue-cli3中element,vue,vue-router通过cdn加载

1、index.html中加入

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.4.7/theme-chalk/index.css">
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.min.js"></script>
<script src="https://cdn.bootcss.com/vuex/3.0.1/vuex.min.js"></script>
<script src="https://cdn.bootcss.com/vue-router/3.0.1/vue-router.min.js"></script>
<script src="https://cdn.bootcss.com/axios/0.15.3/axios.min.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.4.7/index.js"></script>

2、vue.config.js中加入

 

configureWebpack: {
    externals: {
        'vue': 'Vue',
        'vue-router': 'VueRouter',
        'vuex': 'Vuex',
        'axios': 'axios',
        'element-ui': 'ELEMENT'
    }
}

 

posted on 2020-08-19 15:34  草率的龙果果  阅读(1010)  评论(0编辑  收藏  举报

导航