feat(AppNaiveUIProvider): 添加对 NModal 的支持
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 4m6s
CI/CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
严浩
2025-10-30 14:00:43 +08:00
parent b623365e38
commit 75f461df0f

View File

@@ -14,6 +14,7 @@ const themeOverrides: GlobalThemeOverrides = {
const ContextHolder: FunctionalComponent = () => {
window.$nLoadingBar = useLoadingBar();
window.$nDialog = useDialog();
window.$nModal = useModal();
window.$nMessage = useMessage();
window.$nNotification = useNotification();
return createTextVNode();
@@ -25,6 +26,7 @@ declare global {
export interface Window {
$nLoadingBar?: import('naive-ui').LoadingBarProviderInst;
$nDialog?: import('naive-ui').DialogProviderInst;
$nModal?: import('naive-ui').ModalProviderInst;
$nMessage?: import('naive-ui').MessageProviderInst;
$nNotification?: import('naive-ui').NotificationProviderInst;
}
@@ -43,12 +45,14 @@ declare global {
>
<NLoadingBarProvider>
<NDialogProvider>
<NNotificationProvider>
<NMessageProvider>
<ContextHolder />
<slot></slot>
</NMessageProvider>
</NNotificationProvider>
<NModalProvider>
<NNotificationProvider>
<NMessageProvider>
<ContextHolder />
<slot></slot>
</NMessageProvider>
</NNotificationProvider>
</NModalProvider>
</NDialogProvider>
</NLoadingBarProvider>
</NConfigProvider>