关于Vue警告

控制台出现报错:

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

翻译一下:  [Vue警告]:您正在使用Vue的仅运行时版本,而模板编译器不可用。 可以将模板预编译为渲染函数,也可以使用包含编译器的内部版本。

 

解决方法:

  配置项目,在项目根目录下建立一个 vue.config.js的文件

  文件内的代码如下:

1 module.exports = {
2     configureWebpack: {
3         resolve: {
4             alias: {
5                 'vue$': 'vue/dist/vue.esm.js'
6             }
7         }
8     }
9 }

  重启项目即可

posted @ 2020-07-12 17:54  strongerPian  阅读(423)  评论(0编辑  收藏  举报
返回顶端