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

index.mjs 717B

12345678910111213141516171819202122
  1. import "../../constants/form.mjs";
  2. import { useResizeObserver } from "@vueuse/core";
  3. import { computed, ref, shallowRef } from "vue";
  4. //#region ../../packages/hooks/use-calc-input-width/index.ts
  5. function useCalcInputWidth() {
  6. const calculatorRef = shallowRef();
  7. const calculatorWidth = ref(0);
  8. const inputStyle = computed(() => ({ minWidth: `${Math.max(calculatorWidth.value, 11)}px` }));
  9. const resetCalculatorWidth = () => {
  10. calculatorWidth.value = calculatorRef.value?.getBoundingClientRect().width ?? 0;
  11. };
  12. useResizeObserver(calculatorRef, resetCalculatorWidth);
  13. return {
  14. calculatorRef,
  15. calculatorWidth,
  16. inputStyle
  17. };
  18. }
  19. //#endregion
  20. export { useCalcInputWidth };
  21. //# sourceMappingURL=index.mjs.map