This commit is contained in:
落日晚风
2023-12-11 09:23:44 +08:00
parent 39692952f0
commit 376376b875
532 changed files with 0 additions and 82165 deletions
-20
View File
@@ -1,20 +0,0 @@
import { createPinia } from 'pinia';
import piniaPersist from 'pinia-plugin-persist-uni';
// 自动注入所有pinia模块
const files = import.meta.globEager('./*.js');
const modules = {};
Object.keys(files).forEach((key) => {
modules[key.replace(/(.*\/)*([^.]+).*/gi, '$2')] = files[key].default;
});
export const setupPinia = (app) => {
const pinia = createPinia();
pinia.use(piniaPersist);
app.use(pinia);
};
export default (name) => {
return modules[name]();
};