UNPKG

grid-component-editor

Version:

延长loading超时时间;转义伪类中文,防止乱码

24 lines (19 loc) 609 B
import { ReactElement } from 'react'; import { unmountComponentAtNode as unmount, render } from 'react-dom'; export default function Fixed(containerId = 'GE-fixed-root') { const obj = { divEl: null, render(children: ReactElement) { render(children, this.divEl) }, unmount() { unmount(this.divEl) } } obj.divEl = document.getElementById(containerId) if (!obj.divEl) { document.body.appendChild(obj.divEl = document.createElement('div')) obj.divEl.id = containerId } return obj }