vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementatio

2021-08-26 09:17:40

升级webpack3 ->4 导致的报错

Module Error (from ./node_modules/vue-loader/lib/index.js):

[vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.



后来发现是vue和vue-template-compiler版本不一致导致的,重新下一个同版本包就可以了


"vue": "^2.6.10",

"vue-template-compiler": "^2.6.10",


  • 2019-10-16 21:02:47

    vue中mixins的详细分析一

    混入 (mixins): 是一种分发 Vue 组件中可复用功能的非常灵活的方式。混入对象可以包含任意组件选项。当组件使用混入对象时,所有混入对象的选项将被混入该组件本身的选项。

  • 2019-10-16 21:04:47

    vue中mixins的详细分析二

    当混合里面包含异步请求函数,而我们又需要在组件中使用异步请求函数的返回值时,我们会取不到此返回值,如下: