Loading src/components/LPopup.vue +7 −1 Original line number Diff line number Diff line <script> import { onMounted, ref, inject, nextTick } from "vue"; import { onMounted, ref, inject, nextTick, onBeforeUnmount } from "vue"; import { propsBinder, remapEvents, Loading @@ -21,6 +21,7 @@ export default { const useGlobalLeaflet = inject(GLOBAL_LEAFLET_OPT); const bindPopup = inject("bindPopup"); const unbindPopup = inject("unbindPopup"); const { options, methods } = setupPopup(props, leafletRef, context); Loading @@ -42,6 +43,11 @@ export default { bindPopup({ leafletObject: leafletRef.value }); nextTick(() => context.emit("ready", leafletRef.value)); }); onBeforeUnmount(() => { unbindPopup({ leafletObject: leafletRef.value }); }); return { root, leafletObject: leafletRef }; }, render() { Loading src/functions/popup.js +0 −7 Original line number Diff line number Diff line import { onBeforeUnmount, inject } from "vue"; import { popperProps, setupPopper } from "./popper"; export const popupProps = { Loading @@ -12,11 +11,5 @@ export const popupProps = { export const setupPopup = (props, leafletRef) => { const { options, methods } = setupPopper(props, leafletRef); const unbindPopup = inject("unbindPopup"); onBeforeUnmount(() => { unbindPopup(); }); return { options, methods }; }; Loading
src/components/LPopup.vue +7 −1 Original line number Diff line number Diff line <script> import { onMounted, ref, inject, nextTick } from "vue"; import { onMounted, ref, inject, nextTick, onBeforeUnmount } from "vue"; import { propsBinder, remapEvents, Loading @@ -21,6 +21,7 @@ export default { const useGlobalLeaflet = inject(GLOBAL_LEAFLET_OPT); const bindPopup = inject("bindPopup"); const unbindPopup = inject("unbindPopup"); const { options, methods } = setupPopup(props, leafletRef, context); Loading @@ -42,6 +43,11 @@ export default { bindPopup({ leafletObject: leafletRef.value }); nextTick(() => context.emit("ready", leafletRef.value)); }); onBeforeUnmount(() => { unbindPopup({ leafletObject: leafletRef.value }); }); return { root, leafletObject: leafletRef }; }, render() { Loading
src/functions/popup.js +0 −7 Original line number Diff line number Diff line import { onBeforeUnmount, inject } from "vue"; import { popperProps, setupPopper } from "./popper"; export const popupProps = { Loading @@ -12,11 +11,5 @@ export const popupProps = { export const setupPopup = (props, leafletRef) => { const { options, methods } = setupPopper(props, leafletRef); const unbindPopup = inject("unbindPopup"); onBeforeUnmount(() => { unbindPopup(); }); return { options, methods }; };