Уведомление
Легкий notification stack для success, warning, error и info сообщений.
Установка
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 в миллисекундах. |