Хабарлама
Success, warning, error және info хабарламаларына арналған жеңіл notification stack.
Орнату
npx alixan-ui-nuxt add toastҚолдану
app.vue
<template>
<NuxtPage />
<ToastHost /> <!-- Add ToastHost once near the root. It renders only on the client. -->
</template>Example.vue
<script setup lang="ts">
const toast = useToast()
const showToast = () => {
toast.open('Project saved successfully', 'success')
}
</script>
<template>
<Button @click="showToast">Show toast</Button>
</template>API анықтамасы
| Аргумент | Түрі | Әдепкі | Сипаттама |
|---|---|---|---|
| message | string | - | Toast мәтіні. |
| type | 'success' | 'warning' | 'error' | 'info' | 'info' | Toast семантикалық тоны. |
| duration | number | 4000 | Миллисекундтағы auto-close timeout. |