This commit is contained in:
eibons
2025-08-15 21:37:29 +08:00
parent 2d7f77a984
commit ce999372ae
183 changed files with 21567 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
export const crudList: ClCrud.Ref[] = [];
export const emitter: Emitter = {
list: [],
init(events) {
for (const i in events) {
this.on(i, events[i]);
}
},
emit(name, data) {
this.list.forEach((e: EmitterItem) => {
const [_name] = e.name.split("-");
if (name == _name) {
e.callback(data, {
crudList,
refresh(params) {
crudList.forEach((c) => c.refresh(params));
}
});
}
});
},
on(name, callback) {
this.list.push({ name, callback });
}
};