File tree Expand file tree Collapse file tree 2 files changed +4
-28
lines changed
packages/anu-vue/src/composables Expand file tree Collapse file tree 2 files changed +4
-28
lines changed Original file line number Diff line number Diff line change 1
1
import type { ConfigThemes , PluginOptions } from '../plugin'
2
- import { createCustomGlobalState } from '@/composables/useCustomCreateGlobalState'
3
2
4
3
function getThemeColorsCss ( themes : ConfigThemes ) {
5
4
return Object . values ( themes )
@@ -14,7 +13,10 @@ export interface AnuComposableOptions {
14
13
initialTheme : PluginOptions [ 'initialTheme' ]
15
14
}
16
15
17
- export const useAnu = createCustomGlobalState ( ( options : AnuComposableOptions ) => {
16
+ export const useAnu = createGlobalState ( ( options ?: AnuComposableOptions ) => {
17
+ if ( ! options )
18
+ throw new Error ( 'Anu: useAnu composable must be initialized with options first time!' )
19
+
18
20
const themes = ref ( options . themes )
19
21
const activeThemeName = ref ( options . initialTheme )
20
22
const activeTheme = computed ( ( ) => ( {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments