Unverified Commit 0605d3fb authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera
Browse files

feat: wire new render functions

parent 15c03285
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -94,12 +94,13 @@ export default {
      scheduleCreateIcon();
    });

    return { root };
  },
  render() {
    const content = this.$slots.default ? this.$slots.default() : undefined;
    return () => {
      const content = context.slots.default
        ? context.slots.default()
        : undefined;

    return h("div", { ref: "root" }, content);
      return h("div", { ref: root }, content);
    };
  },
};
</script>
+4 −8
Original line number Diff line number Diff line
<script>
import { onMounted, ref, h, provide, inject } from "vue";
import { onMounted, ref, provide, inject } from "vue";
import {
  remapEvents,
  propsBinder,
@@ -8,6 +8,7 @@ import {
  updateLeafletWrapper,
} from "../utils.js";
import { props, setup as markerSetup } from "../functions/marker";
import { render } from "../functions/layer";

/**
 * Marker component, lets you add and personalize markers on the map
@@ -56,13 +57,8 @@ export default {
      });
      ready.value = true;
    });
    return { ready };
  },
  render() {
    if (this.ready && this.$slots.default) {
      return h("div", { style: { display: "none" } }, this.$slots.default());
    }
    return null;

    return render(ready, context);
  },
};
</script>
+3 −8
Original line number Diff line number Diff line
<script>
import { h, onMounted, ref, inject } from "vue";
import { onMounted, ref, inject } from "vue";
import { remapEvents, propsBinder } from "../utils.js";
import { props, setup as polygonSetup } from "../functions/polygon";
import { render } from "../functions/layer";

/**
 * Polygon component, lets you add and customize polygon regions on the map
@@ -36,13 +37,7 @@ export default {
      ready.value = true;
    });

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

/**
 * Polyline component, lets you add and personalize polylines on the map
@@ -36,13 +37,7 @@ export default {
      });
      ready.value = true;
    });
    return { ready };
  },
  render() {
    if (this.ready && this.$slots.default) {
      return h("div", { style: { display: "none" } }, this.$slots.default());
    }
    return null;
    return render(ready, context);
  },
};
</script>
+3 −8
Original line number Diff line number Diff line
<script>
import { onMounted, ref, h, inject } from "vue";
import { onMounted, ref, inject } from "vue";
import { propsBinder, remapEvents } from "../utils.js";
import { setup as popupSetup, props } from "../functions/popup";
import { render } from "../functions/popper";

/**
 * Display a popup on the map
@@ -33,13 +34,7 @@ export default {
      leafletRef.value.setContent(props.content || root.value);
      bindPopup({ leafletObject: leafletRef.value });
    });
    return { root };
  },
  render() {
    if (this.$slots.default) {
      return h("div", { ref: "root" }, this.$slots.default());
    }
    return null;
    return render(root, context);
  },
};
</script>
Loading