vue 组件使用template 选项 报错


报错信息:

vue.runtime.esm.js?2b0e:619 [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.

image-20201117153015248

解决办法:

新建vue.config.js

// vue.config.js
module.exports = {

    runtimeCompiler: true,
}

重启server并重新刷新页面

相关解释:

https://cli.vuejs.org/zh/config/#runtimecompiler


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。