mirror of https://github.com/vuejs/core.git
wip(vapor): fix v-for update check + avoid unnecessary tracking overhead during diff
This commit is contained in:
parent
69422d50d8
commit
11383ae72d
|
@ -3,6 +3,8 @@ import {
|
|||
type ShallowRef,
|
||||
isReactive,
|
||||
isShallow,
|
||||
pauseTracking,
|
||||
resetTracking,
|
||||
shallowReadArray,
|
||||
shallowRef,
|
||||
toReactive,
|
||||
|
@ -88,6 +90,8 @@ export const createFor = (
|
|||
const oldLength = oldBlocks.length
|
||||
newBlocks = new Array(newLength)
|
||||
|
||||
pauseTracking()
|
||||
|
||||
if (!isMounted) {
|
||||
isMounted = true
|
||||
for (let i = 0; i < newLength; i++) {
|
||||
|
@ -269,6 +273,8 @@ export const createFor = (
|
|||
if (parentAnchor) {
|
||||
frag.nodes.push(parentAnchor)
|
||||
}
|
||||
|
||||
resetTracking()
|
||||
}
|
||||
|
||||
const needKey = renderItem.length > 1
|
||||
|
@ -326,7 +332,7 @@ export const createFor = (
|
|||
newKey?: any,
|
||||
newIndex?: any,
|
||||
) => {
|
||||
if (newIndex !== itemRef.value) {
|
||||
if (newItem !== itemRef.value) {
|
||||
itemRef.value = newItem
|
||||
}
|
||||
if (keyRef && newKey !== undefined && newKey !== keyRef.value) {
|
||||
|
|
Loading…
Reference in New Issue