Skip to content

Commit

Permalink
playground(alert): improve actions color
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jun 4, 2024
1 parent ad70bb9 commit 57b32ca
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions playground/pages/alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import theme from '#build/ui/alert'
const variants = Object.keys(theme.variants.variant)
const actions = [{
const actions = (variant?: string) => [{
label: 'Action',
color: (variant === 'solid' ? 'black' as const : 'primary' as const),
click() {
console.log('Action clicked')
}
Expand All @@ -14,7 +15,7 @@ const data = {
title: 'Heads up!',
description: 'You can add components to your app using the cli.',
icon: 'i-heroicons-command-line',
actions,
actions: actions(),
close: true
}
</script>
Expand All @@ -30,6 +31,13 @@ const data = {
<UAlert v-bind="data" color="white" />
<UAlert v-bind="data" color="gray" />
<UAlert v-bind="data" color="black" />
<UAlert v-for="variant in variants" :key="variant" v-bind="data" color="primary" :variant="(variant as any)" />
<UAlert
v-for="variant in variants"
:key="variant"
v-bind="data"
:actions="actions(variant)"
color="primary"
:variant="(variant as any)"
/>
</div>
</template>

0 comments on commit 57b32ca

Please sign in to comment.