d24155831077a8c24ce8c314b1226bf3dab7006a7e42a9872e43b4cedc8b329837d98fb1ab2a1fcabc54f2d99e67852120a59c1b2354e6d4639cab9d37f990 504 B

1234567891011121314151617181920
  1. import { watch } from 'vue';
  2. import { useEventListener } from '@vueuse/core';
  3. const usePreventGlobal = (indicator, evt, cb) => {
  4. const prevent = (e) => {
  5. if (cb(e))
  6. e.stopImmediatePropagation();
  7. };
  8. let stop = void 0;
  9. watch(() => indicator.value, (val) => {
  10. if (val) {
  11. stop = useEventListener(document, evt, prevent, true);
  12. } else {
  13. stop == null ? void 0 : stop();
  14. }
  15. }, { immediate: true });
  16. };
  17. export { usePreventGlobal };
  18. //# sourceMappingURL=index.mjs.map