Уведомление

Легкий 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

АргументТипПо умолчаниюОписание
messagestring-Текст toast.
type'success' | 'warning' | 'error' | 'info''info'Семантический тон toast.
durationnumber4000Таймаут auto-close в миллисекундах.