]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-vapor): remove shallowRef list for v-for (#281)
authorRizumu Ayaka <rizumu@ayaka.moe>
Sat, 28 Sep 2024 16:47:44 +0000 (00:47 +0800)
committerGitHub <noreply@github.com>
Sat, 28 Sep 2024 16:47:44 +0000 (00:47 +0800)
packages/runtime-vapor/src/apiCreateFor.ts

index 6033c3617a0d578d604d0f6e56c8c2a960057b0c..8a566237e5de21e57278fd2005c66e5d2b207478 100644 (file)
@@ -2,7 +2,6 @@ import {
   type EffectScope,
   type ShallowRef,
   effectScope,
-  isReactive,
   shallowRef,
 } from '@vue/reactivity'
 import { isArray, isObject, isString } from '@vue/shared'
@@ -325,11 +324,7 @@ export const createFor = (
   ) {
     const [item, key, index] = block.state
     let needsUpdate =
-      newItem !== item.value ||
-      newKey !== key.value ||
-      newIndex !== index.value ||
-      // shallowRef list
-      (isObject(newItem) && !isReactive(newItem))
+      newItem !== item.value || newKey !== key.value || newIndex !== index.value
     if (needsUpdate) updateState(block, newItem, newKey, newIndex)
   }