提交 f201143e 编写于 作者: tao.wu's avatar tao.wu

no message

上级 934906fb
......@@ -39,11 +39,11 @@ export const checkMobile = (rule, value, callback) => {
// 校验是否是整数
export const checkIsInteger = (rule, value, callback) => {
// const val = parseFloat(value);
// const num = Number.isInteger(val);
const val = parseFloat(value);
const num = Number.isInteger(val);
const val = Number.parseInt(value);
const num = /^[0-9]*[1-9][0-9]*$/.test(value);
// const val = Number.parseInt(value);
// const num = /^[0-9]*[1-9][0-9]*$/.test(value);
if(num || checkNeedRule(val)){
callback()
......
......@@ -39,7 +39,7 @@ export default ($this) => {
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'text',
type: 'number',
labmsg: '次',
slots: [{name: 'cm', type: 'append'}],
rules: [{required: true, message: '请输入身高', trigger: ['submit','change','blur']},{ validator: checkRange , trigger: ['submit','change','blur'] }, {validator: checkIsInteger , trigger: ['submit','change','blur']}],
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册