UNPKG

@alicd/micro-stark

Version:

cone微应用

27 lines (25 loc) 700 B
/** * @name 代理rmoveChild方法 * @desc 微前端模式下切换应用,如果存在弹窗,会导致取消弹窗的方法报错 * @author kaifeng.xkf * @date 2020-10-15 * @export */ const originRemoveChild = HTMLDivElement.prototype.removeChild; export function proxyRemoveChild() { HTMLDivElement.prototype.removeChild = function (...args) { try { originRemoveChild.call(this, ...args); } catch (error) { console.log(error); } } const originBodyremoveChild = document.body.removeChild; document.body.removeChild = function (...args) { try { originBodyremoveChild.call(this, ...args); } catch (error) { console.log(error); } } }