mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
fix(vue-app): re-register components construtor in HMR (#9539)
* fix(vue-app): re-register components construtor in HMR * simpilify checking
This commit is contained in:
parent
356de80e7d
commit
a3b2fd86ad
@ -735,6 +735,13 @@ function hotReloadAPI(_app) {
|
||||
let $components = getNuxtChildComponents(_app.<%= globals.nuxt %>, [])
|
||||
|
||||
$components.forEach(addHotReload.bind(_app))
|
||||
|
||||
if (_app.context.isHMR) {
|
||||
const Components = getMatchedComponents(router.currentRoute)
|
||||
Components.forEach((Component) => {
|
||||
Component.prototype.constructor = Component
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function addHotReload ($component, depth) {
|
||||
|
Loading…
Reference in New Issue
Block a user