|
|
@@ -11,6 +11,7 @@ import {
|
|
|
type TemplateChildNode,
|
|
|
defaultOnError,
|
|
|
defaultOnWarn,
|
|
|
+ getSelfName,
|
|
|
isVSlot,
|
|
|
} from '@vue/compiler-dom'
|
|
|
import { EMPTY_OBJ, NOOP, extend, isArray, isString } from '@vue/shared'
|
|
|
@@ -61,6 +62,7 @@ export type StructuralDirectiveTransform = (
|
|
|
export type TransformOptions = HackOptions<BaseTransformOptions>
|
|
|
|
|
|
export class TransformContext<T extends AllNode = AllNode> {
|
|
|
+ selfName: string | null = null
|
|
|
parent: TransformContext<RootNode | ElementNode> | null = null
|
|
|
root: TransformContext<RootNode>
|
|
|
index: number = 0
|
|
|
@@ -92,6 +94,7 @@ export class TransformContext<T extends AllNode = AllNode> {
|
|
|
) {
|
|
|
this.options = extend({}, defaultOptions, options)
|
|
|
this.root = this as TransformContext<RootNode>
|
|
|
+ if (options.filename) this.selfName = getSelfName(options.filename)
|
|
|
}
|
|
|
|
|
|
enterBlock(ir: BlockIRNode, isVFor: boolean = false): () => void {
|