mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 16:30:45 +01:00
feat(Toast): actions color defaults from prop
This commit is contained in:
@@ -65,7 +65,6 @@ const templates = (id: number) => [{
|
||||
icon: 'i-heroicons-rocket-launch',
|
||||
actions: [{
|
||||
label: 'Action',
|
||||
color: 'primary' as const,
|
||||
variant: 'outline' as const,
|
||||
click() {
|
||||
console.log(`Toast ${id} action clicked`)
|
||||
|
||||
@@ -105,7 +105,7 @@ defineExpose({
|
||||
|
||||
<div v-if="multiline && actions?.length" :class="ui.actions({ multiline: true })">
|
||||
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
||||
<UButton size="xs" color="white" v-bind="action" />
|
||||
<UButton size="xs" :color="color" v-bind="action" />
|
||||
</ToastAction>
|
||||
</div>
|
||||
</div>
|
||||
@@ -113,7 +113,7 @@ defineExpose({
|
||||
<div v-if="(!multiline && actions?.length) || close !== null" :class="ui.actions({ multiline: false })">
|
||||
<template v-if="!multiline">
|
||||
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
||||
<UButton size="xs" color="white" v-bind="action" />
|
||||
<UButton size="xs" :color="color" v-bind="action" />
|
||||
</ToastAction>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user