- 寫了一個js全局組件,包含了template內容
Vue.components('name', {xxxxx})
注冊后引用組件報錯如下:
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-cli3.0解決辦法:
在vue.config.js中增加如下內容,重啟即可:
module.exports = {
runtimeCompiler: true,
}