feat: v-memo
This commit is contained in:
@@ -182,6 +182,9 @@ export interface VNode<
|
||||
|
||||
// application root node only
|
||||
appContext: AppContext | null
|
||||
|
||||
// v-for memo
|
||||
memo?: any[]
|
||||
}
|
||||
|
||||
// Since v-if and v-for are the two possible ways node structure can dynamically
|
||||
@@ -221,7 +224,7 @@ export function closeBlock() {
|
||||
// Only tracks when this value is > 0
|
||||
// We are not using a simple boolean because this value may need to be
|
||||
// incremented/decremented by nested usage of v-once (see below)
|
||||
let isBlockTreeEnabled = 1
|
||||
export let isBlockTreeEnabled = 1
|
||||
|
||||
/**
|
||||
* Block tracking sometimes needs to be disabled, for example during the
|
||||
@@ -692,7 +695,7 @@ export function normalizeVNode(child: VNodeChild): VNode {
|
||||
|
||||
// optimized normalization for template-compiled render fns
|
||||
export function cloneIfMounted(child: VNode): VNode {
|
||||
return child.el === null ? child : cloneVNode(child)
|
||||
return child.el === null || child.memo ? child : cloneVNode(child)
|
||||
}
|
||||
|
||||
export function normalizeChildren(vnode: VNode, children: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user