解决webpack+vue项目报错“You are using the runtime-only build of Vue where the template compiler is not av”

如题,解决webpack+vue项目报错“You are using the runtime-only build of Vue where the template compiler is not available”

解决方法如下图红框加一个vue的别名,直接引入vue/dist/vue.esm.js:

贴代码,附图:

    resolve:{
      extensions: ['.js', '.json', '.vue'], //扩展名省略配置
      alias:{
        //模块别名
        vue: "vue/dist/vue.esm.js", //加上这一句
        '@':resolve('src'),
      }
    },

猜你喜欢

转载自blog.csdn.net/taozi550185271/article/details/109183647
今日推荐