项目升级到 Vue-CLI3后浏览器报错: 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的App组件渲染方式不能再使用,需要升级。
原来加载方式如:
new Vue({
el: '#app',
router,
store,
template: '<App/>',
components: { App }
})
需要改成如下:
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')