perf: pinia中所有getters改为官方推荐写法,this改成state可自动推导类型 (#490)

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
This commit is contained in:
Wit〆苗大
2023-03-28 16:25:56 +08:00
committed by GitHub
parent 990caef48d
commit bff68c3e7b
4 changed files with 17 additions and 17 deletions

View File

@@ -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";