[new feature] AddressEdit support custom tel validator (#673)

This commit is contained in:
neverland
2018-03-07 16:23:10 +08:00
committed by GitHub
parent 2aaf074416
commit 0482558471
6 changed files with 14 additions and 2 deletions
+5 -1
View File
@@ -54,6 +54,10 @@ export default create({
tel: '',
name: ''
})
},
telValidator: {
type: Function,
default: validateMobile
}
},
@@ -84,7 +88,7 @@ export default create({
case 'name':
return value ? value.length <= 15 ? '' : this.$t('nameOverlimit') : this.$t('nameEmpty');
case 'tel':
return validateMobile(value) ? '' : this.$t('telInvalid');
return this.telValidator(value) ? '' : this.$t('telInvalid');
}
},