perf: 页面切换性能优化 (#600)

* perf: 页面切换性能优化

* fix: 修复刷新页面时`router.beforeEach`调用两次的问题
This commit is contained in:
xiaoming
2023-06-13 12:36:54 +08:00
committed by GitHub
parent aec2a35424
commit 5d86b714a4
9 changed files with 28 additions and 83 deletions

View File

@@ -1,21 +1,13 @@
import type { Emitter } from "mitt";
import mitt from "mitt";
/** 全局公共事件需要在此处添加类型 */
type Events = {
resize: {
detail: {
width: number;
height: number;
};
};
openPanel: string;
tagViewsChange: string;
tagViewsShowModel: string;
logoChange: boolean;
changLayoutRoute: {
indexPath: string;
parentPath: string;
};
changLayoutRoute: string;
};
export const emitter: Emitter<Events> = mitt<Events>();