Commit 47fa1971 authored by Michael Underwood's avatar Michael Underwood
Browse files

Render default slot if present on polygon and rectangle layers

parent a2184d7e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
<script>
import { onMounted, ref, inject } from "vue";
import { h, onMounted, ref, inject } from "vue";
import { remapEvents, propsBinder } from "../utils.js";
import { props, setup as polygonSetup } from "../functions/polygon";

@@ -11,6 +11,7 @@ export default {
  props,
  setup(props, context) {
    const leafletRef = ref({});
    const ready = ref(false);
    const addLayer = inject("addLayer");

    const { options, methods } = polygonSetup(props, leafletRef, context);
@@ -32,9 +33,15 @@ export default {
        ...methods,
        leafletObject: leafletRef.value,
      });
      ready.value = true;
    });

    return { ready };
  },
  render() {
    if (this.ready && this.$slots.default) {
      return h("div", { style: { display: "none" } }, this.$slots.default());
    }
    return null;
  },
};
+8 −1
Original line number Diff line number Diff line
<script>
import { onMounted, ref, inject } from "vue";
import { h, onMounted, ref, inject } from "vue";
import { remapEvents, propsBinder } from "../utils.js";
import { props, setup as rectangleSetup } from "../functions/rectangle";

@@ -11,6 +11,7 @@ export default {
  props,
  setup(props, context) {
    const leafletRef = ref({});
    const ready = ref(false);
    const addLayer = inject("addLayer");

    const { options, methods } = rectangleSetup(props, leafletRef, context);
@@ -36,9 +37,15 @@ export default {
        ...methods,
        leafletObject: leafletRef.value,
      });
      ready.value = true;
    });

    return { ready };
  },
  render() {
    if (this.ready && this.$slots.default) {
      return h("div", { style: { display: "none" } }, this.$slots.default());
    }
    return null;
  },
};