Skip to content

Commit d13d5ed

Browse files
committed
wip: slotScopeIds
1 parent 1169db8 commit d13d5ed

File tree

11 files changed

+169
-68
lines changed

11 files changed

+169
-68
lines changed

packages/compiler-vapor/src/generators/component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function genCreateComponent(
4747
const { helper } = context
4848

4949
const tag = genTag()
50-
const { root, props, slots, once } = operation
50+
const { root, props, slots, once, scopeId } = operation
5151
const rawSlots = genRawSlots(slots, context)
5252
const [ids, handlers] = processInlineHandlers(props, context)
5353
const rawProps = context.withId(() => genRawProps(props, context), ids)
@@ -75,6 +75,7 @@ export function genCreateComponent(
7575
rawSlots,
7676
root ? 'true' : false,
7777
once && 'true',
78+
scopeId && JSON.stringify(scopeId),
7879
),
7980
...genDirectivesForElement(operation.id, context),
8081
]

packages/compiler-vapor/src/ir/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export interface CreateComponentIRNode extends BaseIRNode {
197197
dynamic?: SimpleExpressionNode
198198
parent?: number
199199
anchor?: number
200+
scopeId?: string | null
200201
}
201202

202203
export interface DeclareOldRefIRNode extends BaseIRNode {

packages/compiler-vapor/src/transforms/transformElement.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ function transformComponentElement(
133133
root: singleRoot,
134134
slots: [...context.slots],
135135
once: context.inVOnce,
136+
scopeId: context.inSlot ? context.options.scopeId : undefined,
136137
dynamic: dynamicComponent,
137138
}
138139
context.slots = []

packages/runtime-core/src/apiCreateApp.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ export interface VaporInteropInterface {
188188
move(vnode: VNode, container: any, anchor: any): void
189189
slot(n1: VNode | null, n2: VNode, container: any, anchor: any): void
190190

191-
vdomMount: (component: ConcreteComponent, props?: any, slots?: any) => any
191+
vdomMount: (
192+
component: ConcreteComponent,
193+
props?: any,
194+
slots?: any,
195+
scopeId?: string,
196+
) => any
192197
vdomUnmount: UnmountComponentFn
193198
vdomSlot: (
194199
slots: any,

0 commit comments

Comments
 (0)