mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
28 lines
542 B
Vue
28 lines
542 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-ccw',
|
|
label: 'Retry',
|
|
color: 'neutral',
|
|
variant: 'outline',
|
|
onClick: (e) => {
|
|
e?.stopPropagation()
|
|
}
|
|
}]
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<UButton label="Show toast" color="neutral" variant="outline" @click="showToast" />
|
|
</template>
|