mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 08:50:34 +01:00
docs(toast): update
This commit is contained in:
18
docs/app/components/content/examples/toast/ToastExample.vue
Normal file
18
docs/app/components/content/examples/toast/ToastExample.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
const toast = useToast()
|
||||
|
||||
function addToCalendar() {
|
||||
const eventDate = new Date(Date.now() + Math.random() * 31536000000)
|
||||
const formattedDate = eventDate.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })
|
||||
|
||||
toast.add({
|
||||
title: 'Event added to calendar',
|
||||
description: `This event is scheduled for ${formattedDate}.`,
|
||||
icon: 'i-heroicons-calendar-days'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UButton label="Add to calendar" color="gray" variant="outline" icon="i-heroicons-plus" @click="addToCalendar" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user