Skip to content

Commit

Permalink
feat: typed defineProps
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed May 11, 2023
1 parent 17018b6 commit d4430a6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 49 deletions.
16 changes: 7 additions & 9 deletions src/components/AppDivider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

<script setup lang='ts'>
defineProps({
cols: {
type: Number,
default: 12
},
my: {
type: String,
default: 'my-1'
}
withDefaults(defineProps<{
cols: number,
my: string,
}>(), {
cols: 12,
my: 'my-1'
});
</script>
20 changes: 5 additions & 15 deletions src/components/Authenticated/AircraftRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,11 @@ const toggleCallsign = (): void => {
showExtra.value = !showExtra.value;
};
const props = defineProps({
flight: {
type: Object as () => TAdsbdb,
required: true
},
index: {
type: Number,
required: true,
},
showDivider: {
type: Boolean,
required: true
},
});
const props = defineProps<{
flight: TAdsbdb,
index: number,
showDivider: boolean,
}>();
watch(callsign, (i) => {
if (!i) showExtra.value = false;
Expand Down
7 changes: 1 addition & 6 deletions src/components/Authenticated/DisplayRows.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ const clear = ():void => {
clearTimeout(copyTimeout.value);
};
defineProps({
toDisplay: {
type: Array as () => TDataToDisplay,
required: true
}
});
defineProps<{toDisplay: TDataToDisplay}>();
</script>
14 changes: 1 addition & 13 deletions src/components/Authenticated/FlightRoute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,10 @@ const mapHref = (index: number): string => {
return `https://www.google.com/maps/place/@${query},14z/`;
};
const props = defineProps({
flightroute: {
type: Object as () => TFlightRoute,
required: true
},
fl_index: {
type: Number,
required: true
}
});
const props = defineProps<{flightroute: TFlightRoute, fl_index: number}>();
</script>

<style scoped>
/* .flightroutebox{
background-color: rgba(0,0,0,.8);
} */
.divider{
border-top: 1px solid rgba(255,255,255,.35)
Expand Down
7 changes: 1 addition & 6 deletions src/components/Authenticated/ForceUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ const { mobile } = useDisplay();
const emit = defineEmits([ 'refresh' ]);
const props = defineProps({
updateCount: {
type: Number,
required: true
}
});
const props = defineProps<{updateCount: number}>();
const buttonDisabled = computed(() : boolean=> {
return loading.value || updating.value;
Expand Down

0 comments on commit d4430a6

Please sign in to comment.