测试
This commit is contained in:
2
frontend/node_modules/element-plus/es/hooks/use-prevent-global/index.d.ts
generated
vendored
Normal file
2
frontend/node_modules/element-plus/es/hooks/use-prevent-global/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { Ref } from 'vue';
|
||||
export declare const usePreventGlobal: <E extends keyof DocumentEventMap>(indicator: Ref<boolean>, evt: E, cb: (e: DocumentEventMap[E]) => boolean) => void;
|
||||
20
frontend/node_modules/element-plus/es/hooks/use-prevent-global/index.mjs
generated
vendored
Normal file
20
frontend/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
|
||||
1
frontend/node_modules/element-plus/es/hooks/use-prevent-global/index.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/hooks/use-prevent-global/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-prevent-global/index.ts"],"sourcesContent":["import { watch } from 'vue'\nimport { useEventListener } from '@vueuse/core'\n\nimport type { Ref } from 'vue'\n\nexport const usePreventGlobal = <E extends keyof DocumentEventMap>(\n indicator: Ref<boolean>,\n evt: E,\n cb: (e: DocumentEventMap[E]) => boolean\n) => {\n const prevent = (e: DocumentEventMap[E]) => {\n if (cb(e)) e.stopImmediatePropagation()\n }\n let stop: (() => void) | undefined = undefined\n watch(\n () => indicator.value,\n (val) => {\n if (val) {\n stop = useEventListener(document, evt, prevent, true)\n } else {\n stop?.()\n }\n },\n { immediate: true }\n )\n}\n"],"names":[],"mappings":";;;AAEY,MAAC,gBAAgB,GAAG,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,KAAK;AACxD,EAAE,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK;AACzB,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;AACb,MAAM,CAAC,CAAC,wBAAwB,EAAE,CAAC;AACnC,GAAG,CAAC;AACJ,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC;AACpB,EAAE,KAAK,CAAC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK;AACxC,IAAI,IAAI,GAAG,EAAE;AACb,MAAM,IAAI,GAAG,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5D,KAAK,MAAM;AACX,MAAM,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;AACrC,KAAK;AACL,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1B;;;;"}
|
||||
Reference in New Issue
Block a user