data() { //element校验 const checkTemplate = (rule, value, callback) => { if (this._.isEmpty(value)) { return callback(new Error('单据模板不能为空')) } callback() } //vxe-table校验 const roleValid = ({ cellValue }) => { if (cellValue && !['Develop', 'Test', 'Designer', 'PM'].includes(cellValue)) { return new Error('角色输入不正确') } } return {} }
vxeRules: { name: [ { required: true, message: '请输入' }, { validator: nameValid } ], }, validRules: { lngoutitemid: [{ validator(e) { if (e.row.dblamount && !e.cellValue) { return new Error('必填项') } } }] }
标签:return,vxe,校验,new,table,cellValue From: https://www.cnblogs.com/hellofangfang/p/18179301