mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 15:31:46 +01:00
chore: add more composables (#138)
This commit is contained in:
committed by
GitHub
parent
fef93f3198
commit
fd4b608150
@@ -9,7 +9,7 @@
|
||||
v-bind="notification"
|
||||
:class="notification.click && 'cursor-pointer'"
|
||||
@click="notification.click && notification.click(notification)"
|
||||
@close="$toast.removeNotification(notification.id)"
|
||||
@close="toast.removeNotification(notification.id)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -18,10 +18,11 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ToastNotification } from '../../types'
|
||||
import { useToast } from '../../composables/useToast'
|
||||
import Notification from './Notification.vue'
|
||||
import { useNuxtApp, useState } from '#imports'
|
||||
import { useState } from '#imports'
|
||||
|
||||
const { $toast } = useNuxtApp()
|
||||
const toast = useToast()
|
||||
const notifications = useState<ToastNotification[]>('notifications', () => [])
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user