Files
SBPanel-Backend/frontend/admin/node_modules/element-plus/lib/hooks/use-calc-input-width/index.js
CN-JS-HuiBai db7f1ba82f
Some checks failed
build / build (api, amd64, linux) (push) Failing after -51s
build / build (api, arm64, linux) (push) Failing after -52s
build / build (api.exe, amd64, windows) (push) Failing after -51s
使用VUE重构项目
2026-04-20 00:19:11 +08:00

25 lines
947 B
JavaScript

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.js');
const require_form = require('../../constants/form.js');
let _vueuse_core = require("@vueuse/core");
let vue = require("vue");
//#region ../../packages/hooks/use-calc-input-width/index.ts
function useCalcInputWidth() {
const calculatorRef = (0, vue.shallowRef)();
const calculatorWidth = (0, vue.ref)(0);
const inputStyle = (0, vue.computed)(() => ({ minWidth: `${Math.max(calculatorWidth.value, require_form.MINIMUM_INPUT_WIDTH)}px` }));
const resetCalculatorWidth = () => {
calculatorWidth.value = calculatorRef.value?.getBoundingClientRect().width ?? 0;
};
(0, _vueuse_core.useResizeObserver)(calculatorRef, resetCalculatorWidth);
return {
calculatorRef,
calculatorWidth,
inputStyle
};
}
//#endregion
exports.useCalcInputWidth = useCalcInputWidth;
//# sourceMappingURL=index.js.map