aboutsummaryrefslogtreecommitdiff
path: root/src/ui/c-alert/c-alert.vue
diff options
context:
space:
mode:
authorGravatar Corentin THOMASSET <corentin.thomasset74@gmail.com> 2023-11-01 11:11:51 +0100
committerGravatar GitHub <noreply@github.com> 2023-11-01 10:11:51 +0000
commit02b0d0d1a13cb8bcbf7f98339278fd874a0cbc19 (patch)
tree7ecbf28e38d9382811d63d39ea76649ed72dc5c1 /src/ui/c-alert/c-alert.vue
parent4d5a67d96d68e8c7ce790cf95f34c8c15736845e (diff)
downloadit-tools-02b0d0d1a13cb8bcbf7f98339278fd874a0cbc19.tar.gz
it-tools-02b0d0d1a13cb8bcbf7f98339278fd874a0cbc19.tar.zst
it-tools-02b0d0d1a13cb8bcbf7f98339278fd874a0cbc19.zip
fix(encryption): alert on decryption error (#711)
* update(c-alert): Add variant 'error' * fix(encryption): Alert decryption error (#652) * feat(c-alert): added title * refactor(composable): mutualized computedCatch --------- Co-authored-by: code2933 <code2933@outlook.com>
Diffstat (limited to 'src/ui/c-alert/c-alert.vue')
-rw-r--r--src/ui/c-alert/c-alert.vue7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/c-alert/c-alert.vue b/src/ui/c-alert/c-alert.vue
index 607acb9..8a3b55e 100644
--- a/src/ui/c-alert/c-alert.vue
+++ b/src/ui/c-alert/c-alert.vue
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import { useTheme } from './c-alert.theme';
-const props = withDefaults(defineProps<{ type?: 'warning' }>(), { type: 'warning' });
-const { type } = toRefs(props);
+const props = withDefaults(defineProps<{ type?: 'warning'; title?: string }>(), { type: 'warning', title: undefined });
+const { type, title } = toRefs(props);
const theme = useTheme();
const variantTheme = computed(() => theme.value[type.value]);
@@ -17,6 +17,9 @@ const variantTheme = computed(() => theme.value[type.value]);
</div>
<div class="c-alert--content">
+ <div v-if="title" class="c-alert--title" text-15px fw-600>
+ {{ title }}
+ </div>
<slot />
</div>
</div>