mirror of
https://gitee.com/yiming_chang/vue-pure-admin.git
synced 2024-12-02 11:17:39 +08:00
perf: pinia
中所有getters
改为官方推荐写法,this
改成state
可自动推导类型 (#490)
Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
This commit is contained in:
parent
990caef48d
commit
bff68c3e7b
@ -23,11 +23,11 @@ export const useAppStore = defineStore({
|
||||
sortSwap: false
|
||||
}),
|
||||
getters: {
|
||||
getSidebarStatus() {
|
||||
return this.sidebar.opened;
|
||||
getSidebarStatus(state) {
|
||||
return state.sidebar.opened;
|
||||
},
|
||||
getDevice() {
|
||||
return this.device;
|
||||
getDevice(state) {
|
||||
return state.device;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
@ -14,14 +14,14 @@ export const useEpThemeStore = defineStore({
|
||||
getConfig().Theme
|
||||
}),
|
||||
getters: {
|
||||
getEpThemeColor() {
|
||||
return this.epThemeColor;
|
||||
getEpThemeColor(state) {
|
||||
return state.epThemeColor;
|
||||
},
|
||||
/** 用于mix导航模式下hamburger-svg的fill属性 */
|
||||
fill() {
|
||||
if (this.epTheme === "light") {
|
||||
fill(state) {
|
||||
if (state.epTheme === "light") {
|
||||
return "#409eff";
|
||||
} else if (this.epTheme === "yellow") {
|
||||
} else if (state.epTheme === "yellow") {
|
||||
return "#d25f00";
|
||||
} else {
|
||||
return "#fff";
|
||||
|
@ -17,8 +17,8 @@ export const useMultiTagsStore = defineStore({
|
||||
)?.multiTagsCache
|
||||
}),
|
||||
getters: {
|
||||
getMultiTagsCache() {
|
||||
return this.multiTagsCache;
|
||||
getMultiTagsCache(state) {
|
||||
return state.multiTagsCache;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
@ -11,14 +11,14 @@ export const useSettingStore = defineStore({
|
||||
hiddenSideBar: getConfig().HiddenSideBar
|
||||
}),
|
||||
getters: {
|
||||
getTitle() {
|
||||
return this.title;
|
||||
getTitle(state) {
|
||||
return state.title;
|
||||
},
|
||||
getFixedHeader() {
|
||||
return this.fixedHeader;
|
||||
getFixedHeader(state) {
|
||||
return state.fixedHeader;
|
||||
},
|
||||
getHiddenSideBar() {
|
||||
return this.HiddenSideBar;
|
||||
getHiddenSideBar(state) {
|
||||
return state.hiddenSideBar;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
Loading…
Reference in New Issue
Block a user