From 5b54fe5182c1e6513e9644f44b9c7a2e3058a367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Thu, 30 Oct 2025 14:18:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(naive-ui):=20=E6=B7=BB=E5=8A=A0=20Modal=20?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E5=BC=8F=20API=20=E6=94=AF=E6=8C=81=E5=B9=B6?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=B1=BB=E5=9E=8B=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppNaiveUIProvider.vue | 24 ++++++++++++++---------- src/pages/demos/naive-ui-demo.page.vue | 26 +++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/AppNaiveUIProvider.vue b/src/AppNaiveUIProvider.vue index 7d46348..f234b1d 100644 --- a/src/AppNaiveUIProvider.vue +++ b/src/AppNaiveUIProvider.vue @@ -13,6 +13,7 @@ const themeOverrides: GlobalThemeOverrides = { const ContextHolder: FunctionalComponent = () => { window.$nLoadingBar = useLoadingBar(); + window.$nModal = useModal(); window.$nDialog = useDialog(); window.$nMessage = useMessage(); window.$nNotification = useNotification(); @@ -24,6 +25,7 @@ const ContextHolder: FunctionalComponent = () => { declare global { export interface Window { $nLoadingBar?: import('naive-ui').LoadingBarProviderInst; + $nModal?: import('naive-ui').ModalProviderInst; $nDialog?: import('naive-ui').DialogProviderInst; $nMessage?: import('naive-ui').MessageProviderInst; $nNotification?: import('naive-ui').NotificationProviderInst; @@ -41,15 +43,17 @@ declare global { :theme="appStore.isDark ? darkTheme : null" abstract > - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/pages/demos/naive-ui-demo.page.vue b/src/pages/demos/naive-ui-demo.page.vue index 18a77c3..33ddbdd 100644 --- a/src/pages/demos/naive-ui-demo.page.vue +++ b/src/pages/demos/naive-ui-demo.page.vue @@ -1,11 +1,12 @@