listening.ts
//监听文件
import { Subject } from 'rxjs';
export const listenAdd = new Subject();
新增的页面
const submit = async () => {
const temp = await insert(XXXX);
if (temp) {
createMessage.success('新增成功!');
listenAdd .next('add');
replace('/task/distribution');
}
};
表格列表页面
const { reload } = useList();
listenAdd .subscribe(() => {
reload(); //刷新
});