wangrong
2026-08-30 761e5c5fa871959f60e15c971c8d83f2b53d0af5
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
28
29
30
31
32
33
34
import { defineStore } from 'pinia'
import { store } from '@/store/index'
 
interface ShareState {
  shareDisable: boolean
  sharePeRequire: boolean
}
 
export const useShareStore = defineStore('shareStore', {
  state: (): ShareState => {
    return {
      shareDisable: false,
      sharePeRequire: false
    }
  },
  getters: {
    getShareDisable(): boolean {
      return this.shareDisable
    },
    getSharePeRequire(): boolean {
      return this.sharePeRequire
    }
  },
  actions: {
    setData(data: ShareState) {
      this.shareDisable = data.shareDisable
      this.sharePeRequire = data.sharePeRequire
    }
  }
})
 
export const useShareStoreWithOut = () => {
  return useShareStore(store)
}