51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
|
export const usePolicyStore = defineStore('policy', {
|
||
|
state: (): {
|
||
|
policy: {
|
||
|
name: string
|
||
|
description: string
|
||
|
url: string
|
||
|
type: '国家' | '地方' | '企业'
|
||
|
}[]
|
||
|
} => ({
|
||
|
|
||
|
policy: [
|
||
|
{
|
||
|
name: '政策1',
|
||
|
url: 'https://www.baidu.com/policy1',
|
||
|
description: '这是政策1的描述',
|
||
|
type: '国家',
|
||
|
},
|
||
|
{
|
||
|
name: '政策2',
|
||
|
url: 'https://www.baidu.com/policy1',
|
||
|
description: '这是政策1的描述',
|
||
|
type: '国家',
|
||
|
},
|
||
|
{
|
||
|
name: '政策3',
|
||
|
url: 'https://www.baidu.com/policy1',
|
||
|
description: '这是政策1的描述',
|
||
|
type: '国家',
|
||
|
},
|
||
|
{
|
||
|
name: '政策2',
|
||
|
url: 'https://www.example.com/policy2',
|
||
|
description: '这是政策2的描述',
|
||
|
type: '企业',
|
||
|
},
|
||
|
{
|
||
|
name: '政策3',
|
||
|
url: 'https://www.example.com/policy3',
|
||
|
description: '这是政策3的描述',
|
||
|
type: '地方',
|
||
|
},
|
||
|
],
|
||
|
}),
|
||
|
persist: {
|
||
|
storage: persistedState.sessionStorage,
|
||
|
},
|
||
|
})
|
||
|
|
||
|
if (import.meta.hot)
|
||
|
import.meta.hot.accept(acceptHMRUpdate(usePolicyStore, import.meta.hot))
|