UNPKG

@opentiny/vue-renderless

Version:

An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.

31 lines (30 loc) 766 B
import "../chunk-G2ADBYYC.js"; import { afterLeave } from "@opentiny/utils"; import { removeClass } from "@opentiny/utils"; const handleAfterLeave = (emit) => () => { emit("after-leave"); }; const setText = (state) => (text) => { state.text = text; }; const close = ({ state, constants, vm }) => () => { afterLeave( vm, () => { const target = state.fullscreen || state.body ? document.body : state.target; if (vm.$el && vm.$el.parentNode) { removeClass(target, constants.PARENT_RELATIVE_CLS); removeClass(target, constants.PARENT_HIDDEN_CLS); vm.$el.parentNode.removeChild(vm.$el); } state.closed = true; }, 300 ); state.visible = false; }; export { close, handleAfterLeave, setText };