Skip to content

Commit

Permalink
fix(hmr): fix hmr for components managed by keep-alive (vuejs#6809)
Browse files Browse the repository at this point in the history
  • Loading branch information
花果山大圣 authored and zhangzhonghe committed Apr 12, 2023
1 parent e213c07 commit 5f71c79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/runtime-core/src/components/KeepAlive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
invokeArrayFns
} from '@vue/shared'
import { watch } from '../apiWatch'
import { hmrDirtyComponents } from '../hmr'
import {
RendererInternals,
queuePostRenderEffect,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f71c79

Please sign in to comment.