Skip to content

Commit 831b818

Browse files
committed
fix: wrong null value
1 parent c391500 commit 831b818

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

packages/compiler-vapor/__tests__/transforms/__snapshots__/transformSlotOutlet.spec.ts.snap

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`compiler: transform <slot> outlets > default slot outlet 1`] = `
44
"import { createSlot as _createSlot } from 'vue/vapor';
55
66
export function render(_ctx) {
7-
const n0 = _createSlot("default")
7+
const n0 = _createSlot("default", null)
88
return n0
99
}"
1010
`;
@@ -14,7 +14,7 @@ exports[`compiler: transform <slot> outlets > default slot outlet with fallback
1414
const t0 = _template("<div></div>")
1515
1616
export function render(_ctx) {
17-
const n0 = _createSlot("default", () => {
17+
const n0 = _createSlot("default", null, () => {
1818
const n2 = t0()
1919
return n2
2020
})
@@ -39,7 +39,7 @@ exports[`compiler: transform <slot> outlets > dynamically named slot outlet 1`]
3939
"import { createSlot as _createSlot } from 'vue/vapor';
4040
4141
export function render(_ctx) {
42-
const n0 = _createSlot(() => (_ctx.foo + _ctx.bar))
42+
const n0 = _createSlot(() => (_ctx.foo + _ctx.bar), null)
4343
return n0
4444
}"
4545
`;
@@ -48,7 +48,7 @@ exports[`compiler: transform <slot> outlets > dynamically named slot outlet with
4848
"import { createSlot as _createSlot } from 'vue/vapor';
4949
5050
export function render(_ctx) {
51-
const n0 = _createSlot(() => (_ctx.name))
51+
const n0 = _createSlot(() => (_ctx.name), null)
5252
return n0
5353
}"
5454
`;
@@ -58,7 +58,7 @@ exports[`compiler: transform <slot> outlets > named slot outlet with fallback 1`
5858
const t0 = _template("<div></div>")
5959
6060
export function render(_ctx) {
61-
const n0 = _createSlot("foo", () => {
61+
const n0 = _createSlot("foo", null, () => {
6262
const n2 = t0()
6363
return n2
6464
})
@@ -70,7 +70,7 @@ exports[`compiler: transform <slot> outlets > statically named slot outlet 1`] =
7070
"import { createSlot as _createSlot } from 'vue/vapor';
7171
7272
export function render(_ctx) {
73-
const n0 = _createSlot("foo")
73+
const n0 = _createSlot("foo", null)
7474
return n0
7575
}"
7676
`;

packages/compiler-vapor/__tests__/transforms/transformSlotOutlet.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,6 @@ describe('compiler: transform <slot> outlets', () => {
207207
},
208208
])
209209
})
210+
211+
test.todo('error on unexpected custom directive on <slot>')
210212
})

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function genSlotOutlet(oper: SlotOutletIRNode, context: CodegenContext) {
3434
...genCall(
3535
vaporHelper('createSlot'),
3636
nameExpr,
37-
genRawProps() || false,
37+
genRawProps() || 'null',
3838
fallbackArg,
3939
),
4040
)

0 commit comments

Comments
 (0)