Skip to content

Commit 8fc6c11

Browse files
committed
fix: add support of buttons for the alert with html message
1 parent 25a8165 commit 8fc6c11

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

adminforth/spa/src/components/Toast.vue

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@
1818
<div v-else class="af-toast-icon inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200">
1919
<IconCheckCircleSolid class="w-5 h-5" aria-hidden="true" />
2020
</div>
21-
22-
<div class="ms-3 text-sm font-normal max-w-xs pr-2" v-if="toast.messageHtml" v-html="toast.messageHtml"></div>
23-
<div class="ms-3 text-sm font-normal max-w-xs pr-2" v-else>
24-
<div class="flex flex-col items-center justify-center break-all">
21+
<div class="flex flex-col items-center justify-center break-all">
22+
<div class="ms-3 text-sm font-normal max-w-xs pr-2" v-if="toast.messageHtml" v-html="toast.messageHtml"></div>
23+
<div class="ms-3 text-sm font-normal max-w-xs pr-2" v-else>
2524
{{toast.message}}
26-
<div v-if="toast.buttons" class="flex justify-center mt-2 gap-2">
27-
<div v-for="button in toast.buttons" class="af-toast-button rounded-md bg-lightButtonsBackground hover:bg-lightButtonsHover text-lightButtonsText dark:bg-darkPrimary dark:hover:bg-darkButtonsBackground dark:text-darkButtonsText">
28-
<button @click="onButtonClick(button.value)" class="px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/10">
29-
{{ button.label }}
30-
</button>
31-
</div>
25+
</div>
26+
<div v-if="toast.buttons" class="flex mt-2 gap-2 w-full ml-6">
27+
<div v-for="button in toast.buttons" class="af-toast-button rounded-md bg-lightButtonsBackground hover:bg-lightButtonsHover text-lightButtonsText dark:bg-darkPrimary dark:hover:bg-darkButtonsBackground dark:text-darkButtonsText">
28+
<button @click="onButtonClick(button.value)" class="px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/10">
29+
{{ button.label }}
30+
</button>
3231
</div>
3332
</div>
3433
</div>

0 commit comments

Comments
 (0)