mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
playground(alert): improve actions color
This commit is contained in:
@@ -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')
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user