fix notifications
This commit is contained in:
@@ -16,15 +16,17 @@
|
|||||||
:updated-clients="updatedClients",
|
:updated-clients="updatedClients",
|
||||||
@reset-updated-clients="resetUpdatedClients"
|
@reset-updated-clients="resetUpdatedClients"
|
||||||
)
|
)
|
||||||
|
the-notification-provider
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TheHeader from "@/components/TheHeader";
|
import TheHeader from "@/components/TheHeader";
|
||||||
import TheSidebar from "@/components/TheSidebar";
|
import TheSidebar from "@/components/TheSidebar";
|
||||||
|
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "LoggedInLayout",
|
name: "LoggedInLayout",
|
||||||
components: { TheHeader, TheSidebar },
|
components: { TheNotificationProvider, TheHeader, TheSidebar },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isOpenForm: false,
|
isOpenForm: false,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
teleport(:to="appContainer")
|
teleport(:to="appContainer")
|
||||||
.flex.gap-2.flex-col.absolute.bottom-0.pb-2.right-2.overflow-hidden.pt-32(class="w-1/5")
|
.absolute.bottom-0.p-2.right-0.overflow-hidden.z-50(class="w-1/5")
|
||||||
transition-group(name="list")
|
.pt-32(v-if="displayPadding")
|
||||||
|
.flex.gap-2.flex-col.relative
|
||||||
|
transition-group(name="list", @before-leave="displayPadding = true", @after-leave="displayPadding = false")
|
||||||
notification-item(
|
notification-item(
|
||||||
v-for="[id, notification] in notificationsList",
|
v-for="[id, notification] in notificationsList",
|
||||||
:id="id",
|
:id="id",
|
||||||
@@ -22,6 +24,12 @@ export default {
|
|||||||
name: "TheNotificationProvider",
|
name: "TheNotificationProvider",
|
||||||
components: { NotificationItem, BaseButton },
|
components: { NotificationItem, BaseButton },
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
displayPadding: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
appContainer() {
|
appContainer() {
|
||||||
return this.$.appContext.app._container;
|
return this.$.appContext.app._container;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
BaseButton(@click="showModal = true") Открыть модалку
|
BaseButton(@click="showModal = true") Открыть модалку
|
||||||
base-modal(v-model="showModal", title="Тестовый заголовок окна" )
|
base-modal(v-model="showModal", title="Тестовый заголовок окна" )
|
||||||
base-button(@click="addNotification") Добавить уведомление
|
base-button(@click="addNotification") Добавить уведомление
|
||||||
the-notification-provider
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -38,13 +37,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addNotification() {
|
addNotification() {
|
||||||
addNotification(
|
addNotification(new Date().getTime(), "test", "test-text", "warning", 0);
|
||||||
new Date().getTime(),
|
|
||||||
"test",
|
|
||||||
"test-text",
|
|
||||||
"warning",
|
|
||||||
3000
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user