]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(hmr): full diff props for non-sfc component (#2359)
authorunderfin <likui6666666@gmail.com>
Thu, 15 Oct 2020 15:05:12 +0000 (23:05 +0800)
committerGitHub <noreply@github.com>
Thu, 15 Oct 2020 15:05:12 +0000 (11:05 -0400)
close #https://github.com/vitejs/vite/issues/872

packages/runtime-core/src/componentProps.ts

index 9fc2ac78b88ade10b5603770a194468c2d61be34..938318d4a9f929743e35e5d8358684814a665450 100644 (file)
@@ -156,8 +156,14 @@ export function updateProps(
   const [options] = instance.propsOptions
 
   if (
-    // always force full diff if hmr is enabled
-    !(__DEV__ && instance.type.__hmrId) &&
+    // always force full diff in dev
+    // - #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) &&
     !(patchFlag & PatchFlags.FULL_PROPS)
   ) {