mirror of
https://github.com/acepanel/panel.git
synced 2026-02-06 11:23:44 +08:00
22 lines
649 B
Go
22 lines
649 B
Go
import { useThemeStore } from '@/store'
|
|
import mitt from 'mitt'
|
|
import * as NaiveUI from 'naive-ui'
|
|
|
|
export async function setupNaiveDiscreteApi() {
|
|
const themeStore = useThemeStore()
|
|
const configProviderProps = computed(() => ({
|
|
theme: themeStore.naiveTheme,
|
|
themeOverrides: themeStore.naiveThemeOverrides
|
|
}))
|
|
const { message, dialog, notification, loadingBar } = NaiveUI.createDiscreteApi(
|
|
['message', 'dialog', 'notification', 'loadingBar'],
|
|
{ configProviderProps }
|
|
)
|
|
|
|
window.$loadingBar = loadingBar
|
|
window.$notification = notification
|
|
window.$message = message
|
|
window.$dialog = dialog
|
|
window.$bus = mitt()
|
|
}
|