forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppToast.vue
More file actions
43 lines (40 loc) · 1.2 KB
/
Copy pathAppToast.vue
File metadata and controls
43 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<script setup lang="ts">
import { useDisplay } from 'vuetify'
import { mdiCheck, mdiInformation } from '@mdi/js'
const { lgAndUp } = useDisplay()
const notificationsStore = useNotificationsStore()
const notificationActive = computed({
get: () => notificationsStore.notification.active,
set: () => notificationsStore.disableNotification(),
})
</script>
<template>
<v-snackbar
v-model="notificationActive"
variant="tonal"
:color="notificationsStore.notification.type"
:timeout="notificationsStore.notification.timeout"
>
<v-icon
v-if="notificationsStore.notification.type === 'success'"
:color="notificationsStore.notification.type"
:icon="mdiCheck"
/>
<v-icon
v-if="notificationsStore.notification.type === 'info'"
:color="notificationsStore.notification.type"
:icon="mdiInformation"
/>
{{ notificationsStore.notification.message }}
<template #actions>
<v-btn
v-if="lgAndUp"
:color="notificationsStore.notification.type"
variant="text"
@click="notificationsStore.disableNotification()"
>
<span class="font-weight-bold">Close</span>
</v-btn>
</template>
</v-snackbar>
</template>