vue-tianditu2
Version: 
28 lines (27 loc) • 987 B
JavaScript
import { defineComponent as d, h as i, onMounted as c, onUnmounted as u } from "vue";
import { useEvent as a } from "../use/event.mjs";
import { useMapRoot as p } from "../use/mapRoot.mjs";
import { EVENTS as f, PROPS as s, NATIVE_EVENTS as l } from "./use/const.mjs";
import { useInit as v } from "./use/init.mjs";
import { useWatch as C } from "./use/watch.mjs";
const h = d({
  name: "TdtControl",
  props: s,
  emits: f,
  setup(r, { emit: m, slots: n }) {
    let e = i("div");
    return c(async () => {
      u(() => o && (t == null ? void 0 : t.removeControl(o)));
      const t = await p(), o = v(r);
      o.onAdd = () => e.el, o.onRemove = () => {
      }, t.addControl(o), a({ events: l, emit: m, instance: o }), C({ props: r, instance: o }), m("init", o);
    }), () => {
      var t;
      return e = i("div", { class: "tdt-control-custom" }, (t = n.default) == null ? void 0 : t.call(n)), e;
    };
  }
});
export {
  h as TdtControl
};
//# sourceMappingURL=index.mjs.map