style: eslint code

This commit is contained in:
xiaoxian521
2021-08-30 20:58:32 +08:00
parent a2b200f5f2
commit e85f36b76e
6 changed files with 38 additions and 52 deletions

View File

@@ -1,11 +1,11 @@
import defaultSettings from "../../settings"
import { defineStore } from "pinia"
import { store } from "/@/store"
import defaultSettings from "../../settings";
import { defineStore } from "pinia";
import { store } from "/@/store";
interface SettingState {
title: string
fixedHeader: boolean
cachedPageList: string[]
title: string;
fixedHeader: boolean;
cachedPageList: string[];
}
export const useSettingStore = defineStore({
@@ -18,25 +18,25 @@ export const useSettingStore = defineStore({
}),
getters: {
getTitle() {
return this.title
return this.title;
},
getFixedHeader() {
return this.fixedHeader
return this.fixedHeader;
}
},
actions: {
CHANGE_SETTING({ key, value }) {
// eslint-disable-next-line no-prototype-builtins
if (this.hasOwnProperty(key)) {
this[key] = value
this[key] = value;
}
},
changeSetting(data) {
this.CHANGE_SETTING(data)
this.CHANGE_SETTING(data);
}
}
})
});
export function useSettingStoreHook() {
return useSettingStore(store)
return useSettingStore(store);
}