fix(compiler-core): do not mark v-for as stable on const bindings
since the source value may be a reactive array fix vitejs/vite#1956
This commit is contained in:
parent
ec8fd10cec
commit
734c65badd
@ -23,7 +23,8 @@ import {
|
||||
VNodeCall,
|
||||
ForRenderListExpression,
|
||||
BlockCodegenNode,
|
||||
ForIteratorExpression
|
||||
ForIteratorExpression,
|
||||
ConstantTypes
|
||||
} from '../ast'
|
||||
import { createCompilerError, ErrorCodes } from '../errors'
|
||||
import {
|
||||
@ -78,7 +79,7 @@ export const transformFor = createStructuralDirectiveTransform(
|
||||
|
||||
const isStableFragment =
|
||||
forNode.source.type === NodeTypes.SIMPLE_EXPRESSION &&
|
||||
forNode.source.constType > 0
|
||||
forNode.source.constType > ConstantTypes.CAN_SKIP_PATCH
|
||||
const fragmentFlag = isStableFragment
|
||||
? PatchFlags.STABLE_FRAGMENT
|
||||
: keyProp
|
||||
|
Loading…
Reference in New Issue
Block a user