import * as ReactDOM from 'react-dom'; /** 挂在组件到跟上 */ export default function mounting(node: JSX.Element, containerId?: string) { ReactDOM.render(node, getContainer(containerId)); } function getContainer(containerId: string = 'kts-component-invoice-operate-invoicing-authorization') { const div: HTMLElement = document.querySelector(`#${containerId}`) || document.createElement("div"); div.id = containerId; document.body.appendChild(div); return div; }