feat: 修改vuex为pinia

修改vuex为pinia
This commit is contained in:
zc
2021-12-25 13:26:12 +08:00
parent d53c13ecba
commit 41cba750b5
17 changed files with 179 additions and 239 deletions

View File

@@ -1,7 +1,6 @@
import { defineStore } from "pinia";
import { store } from "@/store";
// import {Module} from "vuex";
import {SettingState, RootStateTypes} from "@store/interface";
import {SettingState} from "@store/interface";
import defaultSettings from '../../settings'
const {showSettings, tagsView, fixedHeader, sidebarLogo} = defaultSettings
@@ -16,7 +15,7 @@ export const useSettingStore = defineStore({
sidebarLogo: sidebarLogo,
}),
actions: {
async CHANGE_SETTING( payload: { key: string, value: any }){
async changeSetting( payload: { key: string, value: any }){
const {key, value} = payload
switch (key) {
case 'theme':
@@ -37,9 +36,6 @@ export const useSettingStore = defineStore({
default:
break
}
},
changeSetting(data:any) {
this.CHANGE_SETTING(data)
}
}
})