refactor: allow non i118n text to be passed

This commit is contained in:
Methapon Metanipat 2024-10-25 17:37:04 +07:00
parent b8822f286b
commit adc0934d45

View file

@ -1,18 +1,23 @@
<script setup lang="ts"> <script setup lang="ts">
defineProps<{ defineProps<{
titleI18n: string; title?: string;
titleI18n?: string;
hslaColor?: string; hslaColor?: string;
}>(); }>();
</script> </script>
<template> <template>
<span <div
class="rounded flex flex-center q-pa-xs" 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); `"
> >
&#128900; &#128900;
{{ $t(titleI18n) }} {{ title || (!!titleI18n ? $t(titleI18n) : '-') }}
</span> </div>
</template> </template>
<style scoped></style> <style scoped>
div {
display: inline-flex;
}
</style>