UNPKG

@westacks/vortex

Version:

Server-based routing for SPAs

47 lines (46 loc) 1.14 kB
import { p as c } from "../page-DkBioJVC.js"; import "axios"; import { l as f, v as m } from "../dom-BXbsE9_c.js"; import { u as d, b as a } from "../form-6EHLr-hJ.js"; import { reactive as v, onBeforeUnmount as l } from "vue"; const p = u(f), b = u(m), R = { install: (n) => n.directive("link", p).directive("visible", b) }, S = () => s(c); function F(n, t) { return s(d(n, t)); } function T(n, t = "default") { return s(a(n, t)); } function s({ get: n, subscribe: t }) { const e = v(n()), i = t((o) => { for (const r in e) r in o || delete e[r]; for (const r in o) e[r] = o[r]; }); return l(i), e; } function u(n) { const t = Symbol("vortex-directive-" + Math.random().toString(36).substring(2, 12)); return { mounted(e, i) { const o = n(e, i.value); o && (e[t] = o); }, updated(e, i) { const o = e[t]; o && typeof o.update == "function" && o.update(i.value); }, unmounted(e) { const i = e[t]; i && typeof i.destroy == "function" && i.destroy(), delete e[t]; } }; } export { F as useForm, S as usePage, T as useRemember, R as vortex };