diff --git a/src/components/input-number/input-number.vue b/src/components/input-number/input-number.vue index 37351d0..424ba29 100644 --- a/src/components/input-number/input-number.vue +++ b/src/components/input-number/input-number.vue @@ -54,6 +54,12 @@ export default { type: Number, default: 2 }, + min: { + type: Number, + }, + max: { + type: Number, + }, addonBefore: String, addonAfter: String, allowClear: Boolean, @@ -92,8 +98,15 @@ export default { emit('focus', e); }; const handleBlur = (e) => { + let val = e.target.value + if (props.min+''&& Number(e.target.value) < Number(props.min)) { + val = Number(props.min) + } + if (props.max+''&& Number(e.target.value) > Number(props.max)) { + val = Number(props.max) + } model.value.focus = false; - model.value.setViewValue(e.target.value); + model.value.setViewValue(val); emit('blur', e); }; diff --git a/src/design/index.less b/src/design/index.less index 38f22c9..bb1f4c8 100644 --- a/src/design/index.less +++ b/src/design/index.less @@ -99,4 +99,8 @@ span { justify-content: flex-start; display: inline-flex; } +} +.ant-input-affix-wrapper-disabled { + border-color: transparent !important; + border: 1px solid #fff !important; } \ No newline at end of file diff --git a/src/views/contract/ContractFact/components/createForm.vue b/src/views/contract/ContractFact/components/createForm.vue index 33eeeca..4faee43 100644 --- a/src/views/contract/ContractFact/components/createForm.vue +++ b/src/views/contract/ContractFact/components/createForm.vue @@ -76,7 +76,7 @@ - + @@ -91,7 +91,7 @@ + @blur="amountBlur(formState.amount)" :min="0" :disabled="isDisable" />