refactor(runtime-vapor): remove shallowRef list for v-for (#281)

This commit is contained in:
Rizumu Ayaka 2024-09-29 00:47:44 +08:00 committed by GitHub
parent 5f6cd32d8b
commit eda2a43f07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 6 deletions

View 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)
}