UNPKG

tdesign-pro-component

Version:

ProComponents tdesign-vue-next + Vue3 + TS

31 lines (30 loc) 758 B
import { ref as f, createApp as c, h as p } from "vue"; import s from "tdesign-vue-next"; /* empty css */ import { D as i } from "./DrawerForm-f9CwdHWK.js"; function h(u, l, r) { let e = null, n = null; const o = f(!1), m = () => p(i, { ...l, visible: o.value, onCancel: () => { t(), r && r(); }, onClose: () => { t(), r && r(); }, options: u }); function a() { e || (e = c(m)), n || (n = document.createElement("div")), document.body.appendChild(n), e.use(s), e.use(i), e.mount(n), o.value = !0; } function t() { o.value = !1, setTimeout(() => { e && e.unmount(), n && document.body.removeChild(n), e = null, n = null; }, 100); } return [a, t]; } export { h as u };