elk/components/nav/SelectFontSize.vue

24 lines
498 B
Vue
Raw Normal View History

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