propapier/app/components/Pp/ButtonGroup.vue
webfussel 85e6035a9a add: iteration 1 finished
Finished simple calculator iteration
2025-04-07 18:52:48 +02:00

25 lines
533 B
Vue

<template>
<div class="ButtonGroup">
<button
v-for="(button, index) in buttons"
@click="click(index)"
:class="{ 'active': button.active}"
>
<Icon :name="button.icon" mode="svg" />
<span>{{ button.label }}</span>
</button>
</div>
</template>
<script setup lang="ts">
import type { Button } from '../../../shared/ButtonGroup'
type Props = {
buttons: Button[]
}
defineProps<Props>()
const emit = defineEmits(['click'])
const click = (index : number) => emit('click', index)
</script>