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

21 lines
399 B
Vue
Raw Normal View History

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