1.vue,vue-router,vuex,axios包引入问题
开发环境时,vue.config.js中这样写
js: [
/* '//cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js',
'//cdn.jsdelivr.net/npm/vue-router@3.5.1/dist/vue-router.min.js',
'//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js',
'//cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js' */
'//cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.min.js',
'//cdn.bootcdn.net/ajax/libs/vue-router/3.5.1/vue-router.min.js',
'//cdn.bootcdn.net/ajax/libs/vuex/3.1.1/vuex.min.js',
'//cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js'
]
生产环境中,vue.config.js中这样写
js: [
/* '//cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js',
'//cdn.jsdelivr.net/npm/vue-router@3.5.1/dist/vue-router.min.js',
'//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js',
'//cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js' */
/* '//cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.min.js', */
'//cdn.bootcdn.net/ajax/libs/vue-router/3.5.1/vue-router.min.js',
'//cdn.bootcdn.net/ajax/libs/vuex/3.1.1/vuex.min.js',
'//cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js'
]
在index.html的head标签里这样写
<script src="http://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.min.js"></script>