Skip to content

Уведомления

Для создания оповещений, используйте компонент $notify

vue
<script setup lang="ts">
import { inject } from "vue";
import { Injections } from "luna";

const $notify = inject(Injections.$notify);

const showOk = () => {
  $notify.ok('Успех');
}
const showInfo = () => {
  $notify.info('Информация');
}
const showWarn = () => {
  $notify.warn('Предупреждение');
}
const showError = () => {
  $notify.error('Ошибка', `Подробное сообщение <a href="#">Ссылка</a>`);
}
</script>
<template>
  <button type="button" @click="showOk()">Успех</button>
  <button type="button" @click="showInfo()">Информация</button>
  <button type="button" @click="showWarn()">Предупреждение</button>
  <button type="button" @click="showError()">Ошибка</button>
</template>

Информация

Функции $notify.ok, $notify.info, $notify.warn, $notify.error принимают 3 аргумента:

(title: string, description?: string, closable?: boolean)