27 lines
653 B
Vue
27 lines
653 B
Vue
<script setup lang="ts">
|
|
import { Button } from '@/lib/registry/new-york/ui/button'
|
|
import { ToastAction } from '@/lib/registry/new-york/ui/toast'
|
|
import { useToast } from '@/lib/registry/new-york/ui/toast/use-toast'
|
|
import { h } from 'vue'
|
|
|
|
const { toast } = useToast()
|
|
</script>
|
|
|
|
<template>
|
|
<Button
|
|
variant="outline" @click="() => {
|
|
toast({
|
|
title: 'Uh oh! Something went wrong.',
|
|
description: 'There was a problem with your request.',
|
|
action: h(ToastAction, {
|
|
altText: 'Try again',
|
|
}, {
|
|
default: () => 'Try again',
|
|
}),
|
|
});
|
|
}"
|
|
>
|
|
Show Toast
|
|
</Button>
|
|
</template>
|