Improve layout of groups
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps<{ value: number | undefined }>();
|
||||
const props = defineProps<{
|
||||
value: number | undefined
|
||||
negativeClass?: string
|
||||
positiveClass?: string
|
||||
}>();
|
||||
|
||||
const internalValue = computed(() => Number(props.value ?? 0));
|
||||
|
||||
@ -11,5 +15,5 @@ const formattedValue = computed(() => internalValue.value.toLocaleString(undefin
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="text-right" :class="internalValue < 0 ? 'negative' : ''">{{ formattedValue }} €</span>
|
||||
<span class="text-right" :class="internalValue < 0 ? (negativeClass ?? 'negative') : positiveClass">{{ formattedValue }} €</span>
|
||||
</template>
|
Reference in New Issue
Block a user