Skip to content

Commit 38ec503

Browse files
committed
test: format of slots
1 parent ef38d68 commit 38ec503

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

packages/component-type-helpers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ import HelloWorld from './HelloWorld.vue'
2222
import type { ComponentProps, ComponentSlots } from 'vue-component-type-helpers'
2323

2424
type Props = ComponentProps<typeof HelloWorld> // { msg: string }
25-
type Slots = ComponentSlots<typeof HelloWorld> // { header(_: { num: number; }): any; footer(_: { str: string; }): any; }
25+
type Slots = ComponentSlots<typeof HelloWorld> // { header?: (props: { num: number; }) => any; footer?: (props: { str: string; }) => any; }
2626
```

packages/tsc/tests/__snapshots__/dts.spec.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ type __VLS_PrettifyLocal<T> = {
2828
`;
2929
3030
exports[`vue-tsc-dts > Input: class-slots/component.vue, Output: class-slots/component.vue.d.ts 1`] = `
31-
"import { VNode } from 'vue';
31+
"import type { VNode } from 'vue';
3232
declare const _default: new () => {
3333
$slots: {
34-
default(_: {
34+
default: (props: {
3535
num: number;
36-
}): VNode[];
37-
foo(_: {
36+
}) => VNode[];
37+
foo: (props: {
3838
str: string;
39-
}): VNode[];
39+
}) => VNode[];
4040
};
4141
};
4242
export default _default;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script lang="ts">
2-
import { VNode } from 'vue';
2+
import type { VNode } from 'vue';
33
44
export default {} as new () => {
55
$slots: {
6-
default(_: { num: number; }): VNode[];
7-
foo(_: { str: string; }): VNode[];
6+
default: (props: { num: number; }) => VNode[];
7+
foo: (props: { str: string; }) => VNode[];
88
};
99
};
1010
</script>

test-workspace/tsc/passedFixtures/vue3/#2617/main.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
let UntypedComponent: new () => {
33
$slots: {
4-
default: (_: any) => any
4+
default: (props: any) => any
55
}
66
} = {} as any;
77
</script>

test-workspace/tsc/passedFixtures/vue3/#2758/child.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<script lang="ts" setup generic="T extends Record<string, string>">
1313
defineSlots<
1414
{
15-
[K in `cell:${string}`]?: (_: { value: T[keyof T] }) => any;
15+
[K in `cell:${string}`]?: (props: { value: T[keyof T] }) => any;
1616
} & {
17-
default?: (_: Record<string, any>) => any;
17+
default?: (props: Record<string, any>) => any;
1818
}
1919
>();
2020
</script>

test-workspace/tsc/passedFixtures/vue3/slots/main.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<script lang="ts">
2929
export default {
3030
name: 'Self',
31-
slots: Object as SlotsType<{ foo?: (_: any) => any }>,
31+
slots: Object as SlotsType<{ foo?: (props: any) => any }>,
3232
};
3333
3434
declare const Comp: new <T>(props: { value: T; }) => {

0 commit comments

Comments
 (0)