Files
dancefinder-app/components/pages/events/event-distance.vue
T

33 lines
898 B
Vue
Raw Normal View History

2024-02-05 16:48:02 +01:00
<template>
2024-02-06 07:43:46 +01:00
<v-row dense>
<v-col cols="12" sm="12" md="6">
<v-icon class="me-1" icon='mdi-home' />
2024-02-05 16:48:02 +01:00
<span><strong>{{ distance.origin }}</strong></span>
</v-col>
2024-02-06 07:43:46 +01:00
<v-col cols="12" sm="12" md="6">
<v-icon class="me-1" icon='mdi-car' />
<span>{{ numericDistance }}</span>
<v-icon class="ms-2 me-1" icon='mdi-clock-outline' />
2024-02-05 16:48:02 +01:00
<span>{{ distance.duration }}</span>
</v-col>
</v-row>
</template>
<script setup lang='ts'>
import { computed, type PropType } from 'vue'
import type { DanceHallDistance } from '~/graphql/generated/operations'
2024-02-05 16:48:02 +01:00
const props = defineProps({
distance: {
type: Object as PropType<DanceHallDistance>,
required: true,
},
})
const numericDistance = computed(() =>
`${Number(props.distance.distance / 1000).toLocaleString('sv-SE', {
2024-02-05 16:48:02 +01:00
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})} km`)
2024-02-05 16:48:02 +01:00
</script>