We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vue 的 hot-realod 功能是由 vue-hot-reload-api 实现的 vue-loader 集成了它, 可以通过参数 options.hotReload = true 来启用
vue
options.hotReload = true
但是有些情况下, 页面不会正确的 hot-reload, 下面记录各个问题的解决办法
该问题是由于渲染顶层组件的方式不正确
错误的挂载方式
window.app = new Vue(Index).$mount('#app');
正确的挂载方式
window.app = new Vue({ render: h => h(Index), }).$mount('#app');
参考: vuejs/vue-hot-reload-api#61
该问题是由于挂载 vue-router 的方式不正确
const router = new Router(); Index.router = router; window.app = new Vue({ render: h => h(Index), }).$mount('#app');
const router = new Router(); window.app = new Vue({ render: h => h(Index), router, }).$mount('#app');
The text was updated successfully, but these errors were encountered:
Fix error thrown from vue-hot-reload-api
3e02f3a
Change to proper way to mount root SFC SFC = single file component yinxin630/blog#1
Fix hot reload error
d84d36a
No branches or pull requests
vue
的 hot-realod 功能是由 vue-hot-reload-api 实现的vue-loader 集成了它, 可以通过参数
options.hotReload = true
来启用但是有些情况下, 页面不会正确的 hot-reload, 下面记录各个问题的解决办法
问题一: TypeError: Cannot read property 'extend' of undefined
该问题是由于渲染顶层组件的方式不正确
错误的挂载方式
正确的挂载方式
参考: vuejs/vue-hot-reload-api#61
问题二: [Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined"
该问题是由于挂载 vue-router 的方式不正确
错误的挂载方式
正确的挂载方式
The text was updated successfully, but these errors were encountered: