Unverified Commit 7382da30 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera
Browse files

feat: add popper and tooltip functions

parent 775b0068
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
export const props = {
  content: {
    type: String,
    default: null,
  },
};

export const setup = (props, mapRef) => {
  const options = {};
  const methods = {
    setContent(newVal) {
      if (mapRef.value && newVal !== null && newVal !== undefined) {
        mapRef.value.setContent(newVal);
      }
    },
  };
  return { options, methods };
};
+16 −0
Original line number Diff line number Diff line
import { onBeforeUnmount } from "vue";
import { props as popperProps, setup as popperSetup } from "./popper";

export const props = {
  ...popperProps,
};

export const setup = (props, mapRef, context, lMethods) => {
  const { options, methods } = popperSetup(props, mapRef);

  onBeforeUnmount(() => {
    lMethods.unbindTooltip();
  });

  return { options, methods };
};