Refactor StatItem to use required color prop without defaults

Replaced optional `color` prop with a required one and removed default value handling. Simplified template binding by directly applying inline styles for color. This improves clarity and ensures consistent color usage.
This commit is contained in:
2025-05-04 22:19:06 +02:00
parent 075c246710
commit 3886c7bcbd

View File

@@ -1,18 +1,13 @@
<template>
<v-list-item :color="color" :title="title">
<v-list-item :style="{ color }" :title="title">
{{ count }}
</v-list-item>
</template>
<script lang="ts" setup>
const props = defineProps<{
defineProps<{
title: string
count: number
color?: string
color: string
}>()
// Provide default values for props
const { color = 'primary' } = withDefaults(props, {
color: 'primary'
})
</script>