vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
35 lines (34 loc) • 970 B
JavaScript
import "./index.mjs";
import { render as r, nextTick as p, createVNode as a } from "vue";
import { isObject as s } from "@vexip-ui/utils";
import c from "./spin.vue2.mjs";
const f = {
mounted(o, t) {
p(() => {
const e = s(t.value) ? { ...t.value } : { active: t.value };
e.inner = !0;
const n = a(c, e, null, 0, Object.keys(e)), i = getComputedStyle(o).position;
o.__loading = {
spin: n,
props: e,
originPosition: i
}, i === "static" && (o.style.position = "relative"), r(n, o);
});
},
updated(o, t) {
p(() => {
if (!o.__loading) return;
const e = s(t.value) ? t.value : { active: t.value }, n = o.__loading.spin.component;
n && (Object.keys(e).forEach((i) => {
n.props[i] = e[i];
}), n.props.inner = !0);
});
},
beforeUnmount(o) {
o.__loading && (r(null, o), delete o.__loading);
}
};
export {
f as loading
};
//# sourceMappingURL=directive.mjs.map