Convert other components

This commit is contained in:
2022-02-15 08:20:04 +00:00
parent 452d63c329
commit 5bbd096fc8
4 changed files with 88 additions and 100 deletions

View File

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