[TS] Fix ts-strict errors in Vue components (Part 1) (#3119)

This commit is contained in:
Chenlei Hu
2025-03-17 21:15:00 -04:00
committed by GitHub
parent 329bdff677
commit 2db29fc2af
17 changed files with 60 additions and 42 deletions

View File

@@ -2,7 +2,9 @@
<div class="grid grid-cols-2 gap-2">
<template v-for="col in deviceColumns" :key="col.field">
<div class="font-medium">{{ col.header }}</div>
<div>{{ formatValue(props.device[col.field], col.field) }}</div>
<div>
{{ formatValue(props.device[col.field], col.field) }}
</div>
</template>
</div>
</template>
@@ -15,7 +17,7 @@ const props = defineProps<{
device: DeviceStats
}>()
const deviceColumns = [
const deviceColumns: { field: keyof DeviceStats; header: string }[] = [
{ field: 'name', header: 'Name' },
{ field: 'type', header: 'Type' },
{ field: 'vram_total', header: 'VRAM Total' },