Use setTitle everywhere
All checks were successful
continuous-integration/drone/push Build is passing
ci/woodpecker/push/woodpecker Pipeline was successful
continuous-integration/drone/pr Build is passing
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
2022-02-15 08:35:29 +00:00
parent 4276c51268
commit 0d20d9bfb8
6 changed files with 15 additions and 11 deletions

View File

@ -15,7 +15,7 @@ interface Data {
}
const props = defineProps<{
modelValue: Suggestion,
modelValue: Suggestion | undefined,
type: String
}>();

View File

@ -1,13 +1,15 @@
<script lang="ts" setup>
import { computed } from 'vue';
const props = defineProps<{ value: number }>();
const props = defineProps<{ value: number | undefined }>();
const formattedValue = computed(() => Number(props.value).toLocaleString(undefined, {
const internalValue = computed(() => Number(props.value ?? 0));
const formattedValue = computed(() => internalValue.value.toLocaleString(undefined, {
minimumFractionDigits: 2,
}));
</script>
<template>
<span class="text-right" :class="value < 0 ? 'negative' : ''">{{ formattedValue }} </span>
<span class="text-right" :class="internalValue < 0 ? 'negative' : ''">{{ formattedValue }} </span>
</template>