mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-12 22:22:10 +08:00
添加 PopupContext 组件用于全局提供 message、modal 和 notification 方法 在 global.d.ts 中声明对应的 window 类型 将 analytics 页面的 notification 调用改为使用全局方法
21 lines
504 B
TypeScript
21 lines
504 B
TypeScript
import { defineComponent } from 'vue';
|
|
|
|
import { App } from 'antdv-next';
|
|
|
|
/**
|
|
* 弹窗上下文
|
|
* 提供 message, modal, notification 方法
|
|
* @see https://ant.design/components/app-cn#global-scene-redux
|
|
*/
|
|
export const PopupContext = defineComponent({
|
|
name: 'PopupContext',
|
|
render() {
|
|
const staticFunction = App.useApp();
|
|
window.message = staticFunction.message;
|
|
window.modal = staticFunction.modal;
|
|
window.notification = staticFunction.notification;
|
|
|
|
return null;
|
|
},
|
|
});
|