Bootstrap

el-input校验,只能输入正整数

一、表单校验方式:

fileSort: [
    { required: true, message: "请输入排序", trigger: "blur" },
    { pattern: /^[1-9]\d*$/, message: '请输入正整数',trigger: 'blur' }
]

 二、el-input的type设置为number,然后去掉上下箭头

/deep/ input::-webkit-outer-spin-button,
/deep/ input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
}
/deep/ input[type='number'] {
  -moz-appearance: textfield !important;
}

 

;