Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Dec 3, 2024
1 parent 9548ba1 commit cd5e9cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
v-model:focused="focused"
@change="textInputChanged($event, true)"
>
<template v-for="(_, slot) of $slots" v-slot:[slot]="scope">
<slot :name="slot" v-bind="scope" />
<template v-for="(_, slot) of ($slots as {})" v-slot:[slot]="scope">
<slot :name="slot" v-bind="(scope as any)" />
</template>
</v-text-field>

Expand All @@ -46,8 +46,8 @@
@update:model-value="textInputChanged($event, false)"
@click="menu = !menu"
>
<template v-for="(_, slot) of $slots" v-slot:[slot]="scope">
<slot :name="slot" v-bind="scope" />
<template v-for="(_, slot) of ($slots as {})" v-slot:[slot]="scope">
<slot :name="slot" v-bind="(scope as any)" />
</template>
<template #default>
<!-- TODO: Consider fullscreen modal on small devices -->
Expand Down Expand Up @@ -171,11 +171,11 @@ type DatePickerProps = Omit<
>;
type _InheritedSlots = Omit<VTextField["$slots"], "default">;
// This useless mapped type prevents vue-tsc from getting confused
// This extra mapped type prevents vue-tsc from getting confused
// and failing to emit any types at all. When it encountered the mapped type,
// it doesn't know how to handle it and so leaves it un-transformed.
type InheritedSlots = {
[Property in keyof _InheritedSlots]: _InheritedSlots[Property];
[Property in keyof _InheritedSlots]?: _InheritedSlots[Property];
};
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type _InheritedSlots<
>
>;
// This useless mapped type prevents vue-tsc from getting confused
// This extra mapped type prevents vue-tsc from getting confused
// and failing to emit any types at all. When it encountered the mapped type,
// it doesn't know how to handle it and so leaves it un-transformed.
type InheritedSlots<
Expand All @@ -86,7 +86,7 @@ type InheritedSlots<
ModelCollectionNavigationProperty & { manyToMany: {} }
>
> = {
[Property in keyof _InheritedSlots<TModel, TFor>]: _InheritedSlots<
[Property in keyof _InheritedSlots<TModel, TFor>]?: _InheritedSlots<
TModel,
TFor
>[Property];
Expand Down
4 changes: 2 additions & 2 deletions src/coalesce-vue-vuetify3/src/components/input/c-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ type InheritedProps = Omit<
>;
type _InheritedSlots = Omit<VInput["$slots"] & VField["$slots"], "default">;
// This useless mapped type prevents vue-tsc from getting confused
// This extra mapped type prevents vue-tsc from getting confused
// and failing to emit any types at all. When it encountered the mapped type,
// it doesn't know how to handle it and so leaves it un-transformed.
type InheritedSlots = {
[Property in keyof _InheritedSlots]: _InheritedSlots[Property];
[Property in keyof _InheritedSlots]?: _InheritedSlots[Property];
};
</script>

Expand Down

0 comments on commit cd5e9cd

Please sign in to comment.