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

posted @ 2020-11-17 15:34  makalo  阅读(1719)  评论(0编辑  收藏  举报