Skip to content

Commit bdaf83a

Browse files
authoredNov 8, 2022
fix(hmr): fix hmr for components managed by keep-alive (#6809)
fix #6222
1 parent 4c3203b commit bdaf83a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
invokeArrayFns
3232
} from '@vue/shared'
3333
import { watch } from '../apiWatch'
34+
import { hmrDirtyComponents } from '../hmr'
3435
import {
3536
RendererInternals,
3637
queuePostRenderEffect,
@@ -280,7 +281,9 @@ const KeepAliveImpl: ComponentOptions = {
280281

281282
if (
282283
(include && (!name || !matches(include, name))) ||
283-
(exclude && name && matches(exclude, name))
284+
(exclude && name && matches(exclude, name)) ||
285+
(__DEV__ && hmrDirtyComponents.has(comp))
286+
284287
) {
285288
current = vnode
286289
return rawVNode

0 commit comments

Comments
 (0)
Please sign in to comment.