- 寫了一個(gè)js全局組件卓起,包含了template內(nèi)容
Vue.components('name', {xxxxx})
注冊(cè)后引用組件報(bào)錯(cuò)如下:
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中增加如下內(nèi)容,重啟即可:
module.exports = {
runtimeCompiler: true,
}