123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /*
- * @Author: 廖明明
- * @Date: 2022-03-31 16:36:19
- * @LastEditors: 廖明明
- * @LastEditTime: 2022-04-01 17:45:03
- * @Description:vuex入口文件
- */
- import Vue from "vue";
- import Vuex from "vuex";
- import user from "@/store/modules/user";
- Vue.use(Vuex);
- const myPlugin = (store) => {
- // 当 store 初始化后调用
- let vuexStorage = uni.getStorageSync("vuexStorage");
- if (vuexStorage) {
- console.log(vuexStorage)
- store.replaceState(vuexStorage);
- }
- store.subscribe((mutation, state) => {
- uni.setStorageSync("vuexStorage", state);
- });
- };
- export default new Vuex.Store({
- state: {
- isShowSeiminModel: false
- },
- mutations: {
- //是否显示切换科室弹窗
- changeSeiminModel(state, args) {
- state.isShowSeiminModel = args;
- }
- },
- modules: {
- user,
- },
- plugins: [myPlugin],
- });
|