import { createStore } from 'vuex'
// const files = require.context("./modules", false, /\.ts$/);
const files = import.meta.globEager('./modules/*.ts')
// 创建一个新的 store 实例
let modules = {
state: {},
mutations: {},
actions: {}
};
Object.entries(files).forEach(([key, module]) => {
Object.assign(modules.state, module.state);
Object.assign(modules.mutations, module.mutations);
Object.assign(modules.actions, module.actions);
});
const store = createStore(modules)
export default store;