UNPKG

vue-tianditu2

Version:
41 lines (40 loc) 1.06 kB
import { defineComponent as T, onBeforeMount as t, onUnmounted as M, watch as h } from "vue"; import { useMapRoot as k } from "../../use/mapRoot.mjs"; import { EVENTS as m, PROPS as w } from "./use/const.mjs"; import { useInit as E } from "./use/init.mjs"; const y = T({ name: "TdtCarTrack", props: w, emits: m, setup(i, { emit: u, expose: a }) { return t(async () => { M(() => r == null ? void 0 : r.clear()), a == null || a({ start: f, pause: l, stop: s, clear: e }); const c = await k(); let r = null; h( () => i.Datas, (n) => { r == null || r.clear(), r = null, n.length && (r = E(i, u, c), u("init", r)); }, { immediate: !0 } ); function f() { r == null || r.start(); } function l() { r == null || r.pause(); } function s() { r == null || r.stop(); } function e() { r == null || r.clear(); } }), () => { }; } }); export { y as TdtCarTrack }; //# sourceMappingURL=index.mjs.map