/
githubmirror
/
halo
Обзор
Документация
Войти
/
githubmirror
/
halo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ui/src/formkit/inputs/array/labels/IconifyLabel.vue
37 строк
950 B
Ryan Wang
Update icon sizing utility classes in Iconify components (#8253)
20 янв 2026, 05:21
Не верифицирован
20 янв 2026, 05:21
5367c6b
Код
Авторство
О чём код?
<script lang="ts" setup> import { Icon } from "@iconify/vue"; import { computed } from "vue"; import type { ArrayItemLabelType } from ".."; import type { IconifyFormat, IconifyValue } from "../../iconify/types"; const props = defineProps<{ itemLabel: { type: ArrayItemLabelType; value: string | IconifyValue; format: IconifyFormat; valueOnly?: boolean; }; }>(); const value = computed(() => { if (props.itemLabel.valueOnly) { return props.itemLabel.value as string; } return (props.itemLabel.value as IconifyValue)?.value; }); </script> <template> <div class="inline-flex items-center [&>*]:size-4"> <img v-if="['url', 'dataurl'].includes(itemLabel.format)" :src="value" class="max-w-none" /> <Icon v-else-if="itemLabel.format === 'name'" :icon="value" /> <div v-else class="inline-flex items-center justify-center" v-html="value" ></div> </div> </template>