Skip to content

Commit 0f0dbd1

Browse files
author
Matthew Klein
committed
Move interface definitions outside of <script setup>
Putting them in separate <script> tags lets them be excluded from the type definition for the component. See the error when creating types (e.g. `pnpm vue-tsc --composite false -p tsconfig.app.json --declaration --emitDeclarationOnly`; note that this will generate *.d.ts files next to the source files), and this comment: <vuejs/language-tools#1232 (comment)>
1 parent 7054961 commit 0f0dbd1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/components/SunriseSunset.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
<script setup lang="ts">
2-
import init, { getSunriseSunset } from "@sunrise-cli/pkg/sunrise_cli";
3-
import { type PropType, computed } from "vue";
4-
1+
<script lang="ts">
52
interface Coord {
63
lat: number;
74
lon: number;
85
}
6+
</script>
7+
8+
<script setup lang="ts">
9+
import init, { getSunriseSunset } from "@sunrise-cli/pkg/sunrise_cli";
10+
import { type PropType, computed } from "vue";
911
1012
const props = defineProps({
1113
coords: {

src/components/variable-fonts/VariableFontAxis.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<script setup lang="ts">
2-
import type { PropType } from "vue";
3-
1+
<script lang="ts">
42
interface Opts {
53
id: string;
64
label: string;
@@ -11,6 +9,10 @@ interface Opts {
119
userStep: number;
1210
default: number;
1311
}
12+
</script>
13+
14+
<script setup lang="ts">
15+
import type { PropType } from "vue";
1416
1517
const props = defineProps({
1618
modelValue: {

0 commit comments

Comments
 (0)