diff --git a/src/components/Notifications/NotificationItem.vue b/src/components/Notifications/NotificationItem.vue new file mode 100644 index 0000000..ca2f851 --- /dev/null +++ b/src/components/Notifications/NotificationItem.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/src/components/Notifications/TheNotificationProvider.vue b/src/components/Notifications/TheNotificationProvider.vue new file mode 100644 index 0000000..c887e28 --- /dev/null +++ b/src/components/Notifications/TheNotificationProvider.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/components/Notifications/notificationContext.js b/src/components/Notifications/notificationContext.js new file mode 100644 index 0000000..2615aca --- /dev/null +++ b/src/components/Notifications/notificationContext.js @@ -0,0 +1,16 @@ +import { reactive } from "vue"; + +export const notifications = reactive({}); + +export const addNotification = (id, title, message, type, lifeTime = 0) => { + notifications[id] = { + title, + message, + type, + lifeTime, + }; +}; + +export const deleteNotification = (id) => { + delete notifications[id]; +}; diff --git a/src/pages/settings/TheSettings.vue b/src/pages/settings/TheSettings.vue index 11458da..d4bdb59 100644 --- a/src/pages/settings/TheSettings.vue +++ b/src/pages/settings/TheSettings.vue @@ -3,15 +3,19 @@ v-select(:items="items", placeholder="Выберите значение", v-model="value" ) BaseButton(@click="showModal = true") Открыть модалку base-modal(v-model="showModal", title="Тестовый заголовок окна" ) + base-button(@click="addNotification") Добавить уведомление + the-notification-provider