]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(hmr): fix hmr for components managed by keep-alive (#6809)
author花果山大圣 <316783812@qq.com>
Tue, 8 Nov 2022 06:26:56 +0000 (14:26 +0800)
committerGitHub <noreply@github.com>
Tue, 8 Nov 2022 06:26:56 +0000 (01:26 -0500)
fix #6222

packages/runtime-core/src/components/KeepAlive.ts

index 3fec48140fc441467ce9a1637f51791c64d2bcdb..3bfef7bf9bfbe8fe1022224c9ce662f1fb523cf0 100644 (file)
@@ -31,6 +31,7 @@ import {
   invokeArrayFns
 } from '@vue/shared'
 import { watch } from '../apiWatch'
+import { hmrDirtyComponents } from '../hmr'
 import {
   RendererInternals,
   queuePostRenderEffect,
@@ -280,7 +281,9 @@ const KeepAliveImpl: ComponentOptions = {
 
       if (
         (include && (!name || !matches(include, name))) ||
-        (exclude && name && matches(exclude, name))
+        (exclude && name && matches(exclude, name)) ||
+        (__DEV__ && hmrDirtyComponents.has(comp))
+
       ) {
         current = vnode
         return rawVNode