elk/components/nav/SelectFontSize.vue

24 lines
498 B
Vue
Raw Normal View History

2022-12-23 23:47:13 +01:00
<script lang="ts" setup>
2022-12-24 00:19:17 +01:00
import type { FontSize } from '~/composables/fontSize'
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as FontSize[]
const fontSize = getFontSize()
2022-12-23 23:47:13 +01:00
</script>
<template>
<CommonDropdown>
<slot />
<template #popper>
<CommonDropdownItem
v-for="size in sizes"
:key="size"
:checked="size === fontSize"
2022-12-24 00:19:17 +01:00
@click="fontSize = size"
2022-12-23 23:47:13 +01:00
>
{{ size }}
</CommonDropdownItem>
</template>
</CommonDropdown>
</template>