iview表单验证 报错

收藏
iview
4
Feb 3, 2018

iview的表单验证默认是string,当value值是number类型会报错

回答

小泽回答

将type值改为number

ruleValidate:{
        building: [
            { type: 'number', required: true, message: '必须数字', trigger: 'change' }
        ]
  }

(0)

提交成功