1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| import { reactive, onMounted, ref, Ref } from 'vue'
|
| import { createGlobalState } from '@vueuse/core'
|
| declare global {
| interface Window {
| __globalState: any // 定义你要暴露给 window 的变量的类型
| __BaseState__: {
| workSectionList: Record<string, any>
| }
| }
| }
|
| /**
| * 全局状态
| */
| export const globalState = reactive<Record<string, any>>({})
|
| /**
| * 全局hook
| * @returns
| */
| export const useGlobalState = createGlobalState(() => {
| const state = {}
|
| return state
| })
|
|