-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.vue
72 lines (62 loc) · 1.62 KB
/
App.vue
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<script setup lang="ts">
import Toaster from '@/components/ui/toast/Toaster.vue'
import ConfirmModal from './components/base/ConfirmDialog.vue'
import LoadingOverlay from '@/components/base/LoadingOverlay.vue'
import { useNotificationSocketStore } from '@/stores/socket/notification'
import { notifyMe } from './utils/noti'
const notificationStore = useNotificationSocketStore()
const getMessage = computed(() => {
return notificationStore.getMessage
})
watch(getMessage, (val: any) => {
if (val.event === 'notification') {
notifyMe(val.data)
}
})
const route = useRoute()
const layout = computed(() => {
return route.meta.layout ?? 'DefaultLayout'
})
onMounted(() => {
// loadingStore.setLoading(true)
// showToast({
// title: 'Welcome to Vite Vue3',
// description: 'This is a simple toast message',
// variant: 'default',
// })
// openConfirm()
})
// const confirmDialog = useConfirmDialog()
// const openConfirm = async () => {
// const result = await confirmDialog.open({
// title: 'Are you sure?',
// question: 'Do you really want to delete this item?',
// onlyConfirm: true,
// warning: true,
// })
// console.log('result', result)
// }
</script>
<template>
<ConfirmModal />
<LoadingOverlay />
<!-- <button @click="openConfirm">Open Modal</button> -->
<Toaster />
<component :is="layout">
<RouterView />
</component>
</template>
<style scoped>
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
filter: drop-shadow(0 0 2em #42b883aa);
}
</style>