vue2.0升级vue3.0报错
报错误[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.
-
在main.js中使用vue的compiler模式
new Vue({ router, store, render: h => h(App) }).$mount('#app')
-
在
vue.config.js
中做如下配置:
//webpack
configureWebpack: {
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
}
}
- 重启项目就好了