-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Soybean
committed
Jan 5, 2022
1 parent
5bfb819
commit c804b21
Showing
6 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/components/common/NaiveProvider/components/NaiveProviderContent.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div></div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui'; | ||
// 挂载naive组件的方法至window, 以便在路由钩子函数和请求函数里面调用 | ||
function registerNaiveTools() { | ||
window.$loadingBar = useLoadingBar(); | ||
window.$dialog = useDialog(); | ||
window.$message = useMessage(); | ||
window.$notification = useNotification(); | ||
} | ||
registerNaiveTools(); | ||
</script> | ||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import NaiveProviderContent from './NaiveProviderContent.vue'; | ||
|
||
export { NaiveProviderContent }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<n-loading-bar-provider> | ||
<n-dialog-provider> | ||
<n-notification-provider> | ||
<n-message-provider> | ||
<slot></slot> | ||
<naive-provider-content /> | ||
</n-message-provider> | ||
</n-notification-provider> | ||
</n-dialog-provider> | ||
</n-loading-bar-provider> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { NLoadingBarProvider, NDialogProvider, NNotificationProvider, NMessageProvider } from 'naive-ui'; | ||
import { NaiveProviderContent } from './components'; | ||
</script> | ||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import NaiveProvider from './NaiveProvider/index.vue'; | ||
import SystemLogo from './SystemLogo/index.vue'; | ||
import DarkModeSwitch from './DarkModeSwitch/index.vue'; | ||
|
||
export { SystemLogo, DarkModeSwitch }; | ||
export { NaiveProvider, SystemLogo, DarkModeSwitch }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './common'; | ||
export * from './common'; | ||
export * from './custom'; | ||
export * from './business'; |