mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +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 %>, [])
|
let $components = getNuxtChildComponents(_app.<%= globals.nuxt %>, [])
|
||||||
|
|
||||||
$components.forEach(addHotReload.bind(_app))
|
$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) {
|
function addHotReload ($component, depth) {
|
||||||
|
Loading…
Reference in New Issue
Block a user