fix: store循环引用 (#1880)

This commit is contained in:
march 2023-08-09 11:43:57 +08:00 committed by GitHub
parent b651ef8373
commit c2ce7009e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

3
src/store/helper.ts Normal file
View File

@ -0,0 +1,3 @@
import { createPinia } from 'pinia'
export const store = createPinia()

View File

@ -1,7 +1,5 @@
import type { App } from 'vue'
import { createPinia } from 'pinia'
export const store = createPinia()
import { store } from './helper'
export function setupStore(app: App) {
app.use(store)

View File

@ -1,7 +1,7 @@
import { defineStore } from 'pinia'
import type { AppState, Language, Theme } from './helper'
import { getLocalSetting, setLocalSetting } from './helper'
import { store } from '@/store'
import { store } from '@/store/helper'
export const useAppStore = defineStore('app-store', {
state: (): AppState => getLocalSetting(),

View File

@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { getToken, removeToken, setToken } from './helper'
import { store } from '@/store'
import { store } from '@/store/helper'
import { fetchSession } from '@/api'
interface SessionResponse {