13 lines
294 B
TypeScript
13 lines
294 B
TypeScript
const files = import.meta.glob("@/stores/*.ts", {
|
|
eager: true,
|
|
});
|
|
|
|
const store: Record<string, any> = {};
|
|
// console.log("stores封装",files);
|
|
for (const i in files) {
|
|
const t = i.split("/");
|
|
const name = t[t.length - 1].split(".")[0];
|
|
store[name] = files[i];
|
|
}
|
|
export default store;
|