Files
sensor-web-v2/src/components/TimeWindows.vue
2023-05-11 20:55:28 +02:00

27 lines
553 B
Vue

<template>
<div class="tabs is-centered">
<ul>
<li
v-for="window in props.windows"
:key="window.label"
@click="emit('set-window', window)"
:class="{ 'is-active': window.label === activeWindow?.label }"
>
<a>{{ window.label }}</a>
</li>
</ul>
</div>
</template>
<script setup lang="ts">
import type { Window } from '@/utils/types'
const props = defineProps<{
activeWindow: Window
windows: Window[]
}>()
const emit = defineEmits<{
'set-window': [window: Window]
}>()
</script>