release: v3 release test
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import type { App } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import piniaPluginPersist from 'pinia-plugin-persist'
|
||||
|
||||
const store = createPinia()
|
||||
|
||||
store.use(piniaPluginPersist)
|
||||
|
||||
export const setupStore = (app: App<Element>) => {
|
||||
app.use(store)
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { appModules } from '@/config/app'
|
||||
import type { AppState, LayoutType, ThemeTypes } from '@/config/app'
|
||||
import { setCssVar, humpToUnderline } from '@/utils'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
export const useAppStore = defineStore({
|
||||
id: 'app',
|
||||
state: (): AppState => appModules,
|
||||
persist: {
|
||||
enabled: true
|
||||
},
|
||||
getters: {
|
||||
getBreadcrumb(): boolean {
|
||||
return this.breadcrumb
|
||||
@@ -119,7 +119,6 @@ export const useAppStore = defineStore({
|
||||
return
|
||||
}
|
||||
this.layout = layout
|
||||
wsCache.set('layout', this.layout)
|
||||
},
|
||||
setTitle(title: string) {
|
||||
this.title = title
|
||||
@@ -133,18 +132,15 @@ export const useAppStore = defineStore({
|
||||
document.documentElement.classList.add('light')
|
||||
document.documentElement.classList.remove('dark')
|
||||
}
|
||||
wsCache.set('isDark', this.isDark)
|
||||
},
|
||||
setCurrentSize(currentSize: ElememtPlusSzie) {
|
||||
this.currentSize = currentSize
|
||||
wsCache.set('currentSize', this.currentSize)
|
||||
},
|
||||
setMobile(mobile: boolean) {
|
||||
this.mobile = mobile
|
||||
},
|
||||
setTheme(theme: ThemeTypes) {
|
||||
this.theme = Object.assign(this.theme, theme)
|
||||
wsCache.set('theme', this.theme)
|
||||
},
|
||||
setCssVarTheme() {
|
||||
for (const key in this.theme) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { localeModules, elLocaleMap } from '@/config/locale'
|
||||
import type { LocaleState } from '@/config/locale'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
export const useLocaleStore = defineStore({
|
||||
id: 'locales',
|
||||
state: (): LocaleState => localeModules,
|
||||
persist: {
|
||||
enabled: true
|
||||
},
|
||||
getters: {
|
||||
getCurrentLocale(): LocaleDropdownType {
|
||||
return this.currentLocale
|
||||
@@ -22,7 +22,6 @@ export const useLocaleStore = defineStore({
|
||||
// this.locale = Object.assign(this.locale, localeMap)
|
||||
this.currentLocale.lang = localeMap?.lang
|
||||
this.currentLocale.elLocale = elLocaleMap[localeMap?.lang]
|
||||
wsCache.set('lang', localeMap?.lang)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -26,6 +26,9 @@ export const usePermissionStore = defineStore({
|
||||
isAddRouters: false,
|
||||
menuTabRouters: []
|
||||
}),
|
||||
persist: {
|
||||
enabled: true
|
||||
},
|
||||
getters: {
|
||||
getRouters(): AppRouteRecordRaw[] {
|
||||
return this.routers
|
||||
|
||||
@@ -16,6 +16,9 @@ export const useTagsViewStore = defineStore({
|
||||
visitedViews: [],
|
||||
cachedViews: new Set()
|
||||
}),
|
||||
persist: {
|
||||
enabled: true
|
||||
},
|
||||
getters: {
|
||||
getVisitedViews(): RouteLocationNormalizedLoaded[] {
|
||||
return this.visitedViews
|
||||
|
||||
Reference in New Issue
Block a user