fix(hmr): full diff props for non-sfc component (#2359)
close #https://github.com/vitejs/vite/issues/872
This commit is contained in:
parent
c6443a43c9
commit
e78915a740
@ -156,8 +156,14 @@ export function updateProps(
|
|||||||
const [options] = instance.propsOptions
|
const [options] = instance.propsOptions
|
||||||
|
|
||||||
if (
|
if (
|
||||||
// always force full diff if hmr is enabled
|
// always force full diff in dev
|
||||||
!(__DEV__ && instance.type.__hmrId) &&
|
// - #1942 if hmr is enabled with sfc component
|
||||||
|
// - vite#872 non-sfc component used by sfc component
|
||||||
|
!(
|
||||||
|
__DEV__ &&
|
||||||
|
(instance.type.__hmrId ||
|
||||||
|
(instance.parent && instance.parent.type.__hmrId))
|
||||||
|
) &&
|
||||||
(optimized || patchFlag > 0) &&
|
(optimized || patchFlag > 0) &&
|
||||||
!(patchFlag & PatchFlags.FULL_PROPS)
|
!(patchFlag & PatchFlags.FULL_PROPS)
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user