chat-pc/src/components/common/NotificationApi.vue

21 lines
441 B
Vue
Raw Normal View History

2024-12-24 08:14:21 +00:00
<script lang="ts">
import { defineComponent, getCurrentInstance } from 'vue'
import { useNotification } from 'naive-ui'
export default defineComponent({
setup() {
const ctx = getCurrentInstance()
if (ctx) {
const notification = useNotification()
window['$notification'] = notification
ctx.appContext.config.globalProperties.$notification = notification
}
},
render() {
return null
}
})
</script>