perf(compiler-core): treat v-for with constant exp as a stable fragment (#1394)

This commit is contained in:
HcySunYang
2020-06-18 04:13:14 +08:00
committed by GitHub
parent 8899a90fc4
commit 8a2cf21b71
9 changed files with 125 additions and 24 deletions

View File

@@ -281,7 +281,7 @@ export interface VNodeCall extends Node {
dynamicProps: string | undefined
directives: DirectiveArguments | undefined
isBlock: boolean
isForBlock: boolean
disableTracking: boolean
}
// JS Node Types ---------------------------------------------------------------
@@ -492,7 +492,7 @@ export interface ForCodegenNode extends VNodeCall {
props: undefined
children: ForRenderListExpression
patchFlag: string
isForBlock: true
disableTracking: boolean
}
export interface ForRenderListExpression extends CallExpression {
@@ -543,7 +543,7 @@ export function createVNodeCall(
dynamicProps?: VNodeCall['dynamicProps'],
directives?: VNodeCall['directives'],
isBlock: VNodeCall['isBlock'] = false,
isForBlock: VNodeCall['isForBlock'] = false,
disableTracking: VNodeCall['disableTracking'] = false,
loc = locStub
): VNodeCall {
if (context) {
@@ -567,7 +567,7 @@ export function createVNodeCall(
dynamicProps,
directives,
isBlock,
isForBlock,
disableTracking,
loc
}
}