2
This commit is contained in:
20
normal-admin/node_modules/element-plus/es/hooks/use-prevent-global/index.mjs
generated
vendored
Normal file
20
normal-admin/node_modules/element-plus/es/hooks/use-prevent-global/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { watch } from 'vue';
|
||||
import { useEventListener } from '@vueuse/core';
|
||||
|
||||
const usePreventGlobal = (indicator, evt, cb) => {
|
||||
const prevent = (e) => {
|
||||
if (cb(e))
|
||||
e.stopImmediatePropagation();
|
||||
};
|
||||
let stop = void 0;
|
||||
watch(() => indicator.value, (val) => {
|
||||
if (val) {
|
||||
stop = useEventListener(document, evt, prevent, true);
|
||||
} else {
|
||||
stop == null ? void 0 : stop();
|
||||
}
|
||||
}, { immediate: true });
|
||||
};
|
||||
|
||||
export { usePreventGlobal };
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
Reference in New Issue
Block a user