UNPKG

motion-plus-vue

Version:

Motion Plus Vue

25 lines (24 loc) 544 B
import { mountedStates as u } from "motion-v"; import { ref as f, watch as m } from "vue"; function v(e) { const n = f(); function a(t) { n.value = t == null ? void 0 : t.$el; } m(() => e.isPresent, (t) => { var i; n.value && ((i = u.get(n.value)) == null || i.setActive("exit", !t)); }); function o(t) { var i; t.detail.isExit && !e.isPresent && ((i = e.onRemove) == null || i.call(e, e.partKey, t.target)); } return { root: n, getRoot: a, handleComplete: o }; } export { v as useAnimate };