mirror of
https://github.com/talktao/Vue3-Vite-Vant-TS-H5.git
synced 2025-04-26 19:46:35 +08:00
init:Vuex初始化
This commit is contained in:
parent
350d5aa91f
commit
2150565c85
29
src/store/index.ts
Normal file
29
src/store/index.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { createStore } from "vuex";
|
||||||
|
|
||||||
|
const store = createStore({
|
||||||
|
state: {
|
||||||
|
|
||||||
|
isLoading: false,
|
||||||
|
|
||||||
|
userNmae: "vue3.0开发H5模板"
|
||||||
|
},
|
||||||
|
getters: {
|
||||||
|
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
|
||||||
|
changeIsLoading(state, val) {
|
||||||
|
state.isLoading = val;
|
||||||
|
},
|
||||||
|
|
||||||
|
getUserNmae(state,data) {
|
||||||
|
state.userNmae = data
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
|
||||||
|
},
|
||||||
|
modules: {},
|
||||||
|
});
|
||||||
|
export default store;
|
Loading…
x
Reference in New Issue
Block a user