UNPKG

vue-tianditu2

Version:
45 lines (44 loc) 1.2 kB
import { defineComponent as p, onBeforeMount as l, onUnmounted as d } from "vue"; import { useMapRoot as M } from "../use/mapRoot.mjs"; import { EVENTS as E, PROPS as h } from "./use/const.mjs"; import { useInit as y } from "./use/init.mjs"; import { useWatch as T } from "./use/watch.mjs"; import { useEvent as C } from "./use/event.mjs"; const k = p({ name: "TdtMousetool", props: h, emits: E, setup(e, { emit: c, expose: r }) { return l(async () => { d(() => m()), r == null || r({ open: a, close: i, clear: s, clearAll: m }); const u = await M(), n = y(e, u); C({ emit: c, instances: n }), T({ props: e, instances: n }), c("init", n); function a(o) { var t; (t = n[o]) == null || t.open(); } function i(o) { var t; (t = n[o]) == null || t.close(); } function s(o) { var t; try { (t = n[o]) == null || t.clear(); } catch (f) { console.error(f); } } function m() { Object.keys(n).forEach((o) => { i(o), s(o); }); } }), () => { }; } }); export { k as TdtMousetool }; //# sourceMappingURL=index.mjs.map