数字输入框在项目中十分常用,但是有一些属性影响使用体验。解决方案如下:
1、整数文字提示
解决方法,将title=""
title=""
2、鼠标滚轮会修改数值,容易误操作
@mousewheel.native.prevent @DOMMouseScroll.native.prevent
3、右侧出现上线箭头
input::-webkit-outer-spin-button,input::-webkit-inner-spin-button {-webkit-appearance: none;}input[type='number'] {-moz-appearance: textfield;}
4、InputNumber 去掉上下箭头
form .ant-input-number-handler-wrap {display: none;}