feat(compiler): support v-for on named slots

This commit is contained in:
Evan You
2019-10-02 23:10:41 -04:00
parent f401ac6b88
commit fc47029ed3
18 changed files with 645 additions and 277 deletions

View File

@@ -12,7 +12,7 @@ import { transformElement } from './transforms/transformElement'
import { transformOn } from './transforms/vOn'
import { transformBind } from './transforms/vBind'
import { defaultOnError, createCompilerError, ErrorCodes } from './errors'
import { trackSlotScopes } from './transforms/vSlot'
import { trackSlotScopes, trackVForSlotScopes } from './transforms/vSlot'
import { optimizeText } from './transforms/optimizeText'
export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions
@@ -45,7 +45,14 @@ export function baseCompile(
nodeTransforms: [
transformIf,
transformFor,
...(prefixIdentifiers ? [transformExpression, trackSlotScopes] : []),
...(prefixIdentifiers
? [
// order is important
trackVForSlotScopes,
transformExpression,
trackSlotScopes
]
: []),
optimizeText,
transformStyle,
transformSlotOutlet,