智慧水务管理系统 - 精河县供水工程综合管理平台

index.mjs 942B

12345678910111213141516171819202122232425262728293031323334
  1. import { nextTick, ref } from "vue";
  2. //#region ../../packages/hooks/use-composition/index.ts
  3. function useComposition({ afterComposition, emit }) {
  4. const isComposing = ref(false);
  5. const handleCompositionStart = (event) => {
  6. emit?.("compositionstart", event);
  7. isComposing.value = true;
  8. };
  9. const handleCompositionUpdate = (event) => {
  10. emit?.("compositionupdate", event);
  11. isComposing.value = true;
  12. };
  13. const handleCompositionEnd = (event) => {
  14. emit?.("compositionend", event);
  15. if (isComposing.value) {
  16. isComposing.value = false;
  17. nextTick(() => afterComposition(event));
  18. }
  19. };
  20. const handleComposition = (event) => {
  21. event.type === "compositionend" ? handleCompositionEnd(event) : handleCompositionUpdate(event);
  22. };
  23. return {
  24. isComposing,
  25. handleComposition,
  26. handleCompositionStart,
  27. handleCompositionUpdate,
  28. handleCompositionEnd
  29. };
  30. }
  31. //#endregion
  32. export { useComposition };
  33. //# sourceMappingURL=index.mjs.map