feat: add icon support for badge component
This commit is contained in:
parent
8ea21b1795
commit
de20b984e8
1 changed files with 4 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { Icon } from '@iconify/vue';
|
||||||
defineProps<{
|
defineProps<{
|
||||||
|
icon?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
titleI18n?: string;
|
titleI18n?: string;
|
||||||
hslaColor?: string;
|
hslaColor?: string;
|
||||||
|
|
@ -11,7 +13,8 @@ defineProps<{
|
||||||
class="rounded q-px-sm flex-center"
|
class="rounded q-px-sm flex-center"
|
||||||
:style="`color: hsla(var(${!!hslaColor ? hslaColor : '--green-6-hsl'}) / 0.8); background: hsla(var(${!!hslaColor ? hslaColor : '--green-6-hsl'}) / 0.1); `"
|
:style="`color: hsla(var(${!!hslaColor ? hslaColor : '--green-6-hsl'}) / 0.8); background: hsla(var(${!!hslaColor ? hslaColor : '--green-6-hsl'}) / 0.1); `"
|
||||||
>
|
>
|
||||||
🞄
|
<template v-if="!icon">🞄</template>
|
||||||
|
<Icon v-else :icon style="margin-right: 0.25rem" />
|
||||||
{{ title || (!!titleI18n ? $t(titleI18n) : '-') }}
|
{{ title || (!!titleI18n ? $t(titleI18n) : '-') }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue