mirror of https://github.com/vuejs/core.git
refactor: memoIndex -> cacheIndex
This commit is contained in:
parent
aef807746a
commit
2815531fd5
|
@ -15,7 +15,7 @@ export function withMemo(
|
||||||
|
|
||||||
// shallow clone
|
// shallow clone
|
||||||
ret.memo = memo.slice()
|
ret.memo = memo.slice()
|
||||||
ret.memoIndex = index
|
ret.cacheIndex = index
|
||||||
|
|
||||||
return (cache[index] = ret)
|
return (cache[index] = ret)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2109,7 +2109,7 @@ function baseCreateRenderer(
|
||||||
shapeFlag,
|
shapeFlag,
|
||||||
patchFlag,
|
patchFlag,
|
||||||
dirs,
|
dirs,
|
||||||
memoIndex,
|
cacheIndex,
|
||||||
} = vnode
|
} = vnode
|
||||||
|
|
||||||
if (patchFlag === PatchFlags.BAIL) {
|
if (patchFlag === PatchFlags.BAIL) {
|
||||||
|
@ -2122,8 +2122,8 @@ function baseCreateRenderer(
|
||||||
}
|
}
|
||||||
|
|
||||||
// #6593 should clean memo cache when unmount
|
// #6593 should clean memo cache when unmount
|
||||||
if (memoIndex != null) {
|
if (cacheIndex != null) {
|
||||||
parentComponent!.renderCache[memoIndex] = undefined
|
parentComponent!.renderCache[cacheIndex] = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE) {
|
if (shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE) {
|
||||||
|
|
|
@ -243,7 +243,7 @@ export interface VNode<
|
||||||
/**
|
/**
|
||||||
* @internal index for cleaning v-memo cache
|
* @internal index for cleaning v-memo cache
|
||||||
*/
|
*/
|
||||||
memoIndex?: number
|
cacheIndex?: number
|
||||||
/**
|
/**
|
||||||
* @internal __COMPAT__ only
|
* @internal __COMPAT__ only
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue