feat(router): 增强路由组件加载逻辑
1. 修改卸载timer、event、script的逻辑 2. 修改加载script的逻辑
This commit is contained in:
@@ -51,13 +51,12 @@ export class ScriptManager {
|
||||
};
|
||||
s.onerror = () => {
|
||||
reject(new Error(`Failed to load script: ${path}`));
|
||||
}
|
||||
};
|
||||
document.body.appendChild(s);
|
||||
});
|
||||
}
|
||||
|
||||
async unloadScript() {
|
||||
console.log('unloadScript');
|
||||
if (this.currentScriptEl) {
|
||||
try {
|
||||
this.currentScriptEl.remove();
|
||||
|
||||
Reference in New Issue
Block a user