Skip to content

Commit d381c2f

Browse files
authored
feat(runtime-vapor): add withVaporCtx helper to manage currentInstance context in slot blocks (#14007)
1 parent 07b4547 commit d381c2f

File tree

6 files changed

+111
-89
lines changed

6 files changed

+111
-89
lines changed

packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function render(_ctx) {
2626
`;
2727

2828
exports[`compile > custom directive > component 1`] = `
29-
"import { resolveComponent as _resolveComponent, resolveDirective as _resolveDirective, setInsertionState as _setInsertionState, createComponentWithFallback as _createComponentWithFallback, withVaporDirectives as _withVaporDirectives, createIf as _createIf, template as _template } from 'vue';
29+
"import { resolveComponent as _resolveComponent, resolveDirective as _resolveDirective, setInsertionState as _setInsertionState, createComponentWithFallback as _createComponentWithFallback, withVaporDirectives as _withVaporDirectives, createIf as _createIf, withVaporCtx as _withVaporCtx, template as _template } from 'vue';
3030
const t0 = _template("<div></div>")
3131
3232
export function render(_ctx) {
@@ -35,7 +35,7 @@ export function render(_ctx) {
3535
const _directive_hello = _resolveDirective("hello")
3636
const _directive_test = _resolveDirective("test")
3737
const n4 = _createComponentWithFallback(_component_Comp, null, {
38-
"default": () => {
38+
"default": _withVaporCtx(() => {
3939
const n0 = _createIf(() => (true), () => {
4040
const n3 = t0()
4141
_setInsertionState(n3, null, true)
@@ -44,7 +44,7 @@ export function render(_ctx) {
4444
return n3
4545
})
4646
return n0
47-
}
47+
})
4848
}, true)
4949
_withVaporDirectives(n4, [[_directive_test]])
5050
return n4

0 commit comments

Comments
 (0)