vue项目部署至服务器报错vue is not defined

vue项目部署至服务器报错vue is not defined,有几个文件访问不到:

 刚开始不知道,找不着文件,后面搜到了cdn。应该是cdn挂了,替换了另一个cdn网站:bootcdn.cn

本地打包部署系统就通了,关于cdn也是今天刚知道,后面了解一下。这个配置在vue.config.js里面:

const assetsCDN = {
  // webpack build externals
  externals: {
    vue: 'Vue',
    'vue-router': 'VueRouter',
    vuex: 'Vuex',
    axios: 'axios'
  },
  css: [],
  // https://unpkg.com/browse/[email protected]/
  js: [
    //替换的cdn
    '//cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.min.js',
    '//cdn.bootcdn.net/ajax/libs/vue-router/3.1.3/vue-router.min.js',
    '//cdn.bootcdn.net/ajax/libs/vuex/3.1.1/vuex.min.js',
    '//cdn.bootcdn.net/ajax/libs/axios/0.19.0/axios.min.js'
    //原来的cdn
    // '//cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js',
    // '//cdn.jsdelivr.net/npm/[email protected]/dist/vue-router.min.js',
    // '//cdn.jsdelivr.net/npm/[email protected]/dist/vuex.min.js',
    // '//cdn.jsdelivr.net/npm/[email protected]/dist/axios.min.js'
  ]
}

你可能感兴趣的:(前端,vue.js,前端,javascript)