Home > Article > Web Front-end > Select selector multi-selection verification method in iview
Below I will share with you an article about the multi-selection verification method of the Select selector in iview. It has a good reference value and I hope it will be helpful to everyone.
Use the multiple attribute in the select component provided by iview to enable multiple selection mode, and the returned data is also in the form of an array.
The verification used by iview is based on async-validator to implement data verification. For verification rules, you can go to the open source project
. The select component verification in multi-select mode uses type as array. You can set the len attribute to specify the length of the array. If len:1 is set, it will pass if the array length is 1. Verification, if not set, the array will pass the verification if there are elements.
{ type: 'array', required: true, message: '不能为空'}
Regular rules can be written in data
in You can quote it in the rules
#The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
Introduction to the calling sequence of functions in vue
JS implementation of adding events to dynamically created elements Operation example
Vue’s route dynamic redirection and navigation guard example
##
The above is the detailed content of Select selector multi-selection verification method in iview. For more information, please follow other related articles on the PHP Chinese website!