14 lines
564 B
Plaintext
14 lines
564 B
Plaintext
import { computed, defineComponent, ref } from 'vue'
|
|
import { createDiscreteApi, type ConfigProviderProps, darkTheme, lightTheme } from 'naive-ui'
|
|
|
|
const themeRef = ref<'light' | 'dark'>('light')
|
|
const configProviderPropsRef = computed<ConfigProviderProps>(() => ({
|
|
theme: themeRef.value === 'light' ? lightTheme : darkTheme,
|
|
}))
|
|
|
|
const { message, notification, dialog, loadingBar } = createDiscreteApi(['message', 'dialog', 'notification', 'loadingBar'], {
|
|
configProviderProps: configProviderPropsRef,
|
|
})
|
|
|
|
export { message, notification, dialog, loadingBar }
|