欢迎光临散文网 会员登陆 & 注册

You are using the runtime-only build of Vue where the template c

2022-02-05 15:46 作者:老尚带你学前端  | 我要投稿

F12控制台报错信息:

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.

报错截图:

原因简述:

在项目配置的时候,默认 npm 包导出的是运行时构建,即 runtime 版本,不支持编译 template 模板。意思是说,你使用的是仅运行时的版本的模板。。。

【1】最简单解决方法:

在项目根目录添加:vue.config.js文件,

内容为:

【2】把main.js中的代码改成这样:

//----------------

版本:vue2、@vue/cli 4.5.13、node v16.13.0、npm 7.20.6、win10

扩展资料:百度查控制台的报错信息英文提示,有一堆。。。


You are using the runtime-only build of Vue where the template c的评论 (共 条)

分享到微博请遵守国家法律