fear: 集成Naive UI Notification组件

This commit is contained in:
张传龙 2022-05-24 15:13:11 +08:00
parent 85f9c91d6e
commit ffc042167a
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,10 @@
<template></template>
<script setup>
import { useNotification } from 'naive-ui'
window['$notification'] = useNotification()
Object.defineProperty(window, '$notification', {
configurable: false,
writable: false,
})
</script>

View File

@ -6,7 +6,10 @@
<DialogContent />
<n-message-provider>
<MessageContent />
<n-notification-provider>
<NotificationContent />
<slot></slot>
</n-notification-provider>
</n-message-provider>
</n-dialog-provider>
</n-loading-bar-provider>
@ -18,6 +21,7 @@ import MessageContent from './MessageContent.vue'
import DialogContent from './DialogContent.vue'
import LoadingBar from './LoadingBar.vue'
import { useThemeStore } from '@/store/modules/theme'
import NotificationContent from './NotificationContent.vue'
const useTheme = useThemeStore()
</script>