Skip to content

Commit 902e00b

Browse files
committed
chore: add render test case
1 parent 31b851f commit 902e00b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

packages-private/dts-test/defineVaporComponent.test-d.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,29 @@ describe('slots', () => {
969969
)
970970
})
971971

972+
describe('render', () => {
973+
defineVaporComponent({
974+
props: {
975+
foo: Number,
976+
},
977+
emits: {
978+
change: (e: number) => {},
979+
},
980+
slots: {} as { default: () => [] },
981+
setup() {
982+
return {
983+
bar: '',
984+
}
985+
},
986+
render(ctx, props, emit, attrs, slots) {
987+
expectType<number | undefined>(props.foo)
988+
expectType<string>(ctx.bar)
989+
emit('change', 1)
990+
return slots.default()
991+
},
992+
})
993+
})
994+
972995
// #5885
973996
describe('should work when props type is incompatible with setup returned type ', () => {
974997
type SizeType = 'small' | 'big'

packages/runtime-vapor/src/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export interface ObjectVaporComponent<
118118
props: Readonly<InferredProps>,
119119
emit: EmitFn<Emits>,
120120
attrs: any,
121-
slots: StaticSlots,
121+
slots: Slots,
122122
): RenderReturn<TypeBlock>
123123

124124
name?: string

0 commit comments

Comments
 (0)