mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
[new feature] AddressEdit support custom tel validator (#673)
This commit is contained in:
@@ -126,6 +126,10 @@ export default create({
|
||||
searchResult: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
telValidator: {
|
||||
type: Function,
|
||||
default: validateMobile
|
||||
}
|
||||
},
|
||||
|
||||
@@ -233,7 +237,7 @@ export default create({
|
||||
case 'name':
|
||||
return value ? value.length <= 15 ? '' : $t('nameOverlimit') : $t('nameEmpty');
|
||||
case 'tel':
|
||||
return validateMobile(value) ? '' : $t('telWrong');
|
||||
return this.telValidator(value) ? '' : $t('telWrong');
|
||||
case 'area_code':
|
||||
return value ? +value !== -1 ? '' : $t('areaWrong') : $t('areaEmpty');
|
||||
case 'address_detail':
|
||||
|
Reference in New Issue
Block a user