Files
ui/docs/app/components/content/examples/toast/ToastActionsExample.vue
Guillaume Chau bc2bcb30d9 fix(icons): make loading icon clockwise (#2797)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
2024-11-28 15:18:14 +01:00

28 lines
541 B
Vue

<script setup lang="ts">
const toast = useToast()
const props = defineProps<{
description: string
}>()
function showToast() {
toast.add({
title: 'Uh oh! Something went wrong.',
description: props.description,
actions: [{
icon: 'i-lucide-refresh-cw',
label: 'Retry',
color: 'neutral',
variant: 'outline',
onClick: (e) => {
e?.stopPropagation()
}
}]
})
}
</script>
<template>
<UButton label="Show toast" color="neutral" variant="outline" @click="showToast" />
</template>