useConditionDropdownPopupInjection.js 437 B

12345678910111213
  1. import {injectLocal, provideLocal} from "@vueuse/core";
  2. const key = Symbol('CONDITION_DROPDOWN_POPUP')
  3. export const useProvideConditionDropdownPopup = (refOrGetter, bottomEleRef, containerEleRef) => {
  4. const options = {popup: refOrGetter, bottom: bottomEleRef, container: containerEleRef}
  5. provideLocal(key, options)
  6. return options
  7. }
  8. export const useInjectConditionDropdownPopup = function () {
  9. return injectLocal(key)
  10. }