This article mainly introduces to you the detailed explanation of how to use Vee-Validate. The editor thinks it is quite good, so I will share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.
Introduction:
##
npm install vee-validate --save
##import VeeValidate from 'vee-validate';
import zh_CN from 'vee-validate/dist/locale/zh_CN'; //Introducing the Chinese package, the prompt information can be displayed in Chinese form
import { Validator } from 'vee-validate';
Validator.addLocale(zh_CN); // Set the prompt information to be displayed in Chinese
const config = {
errorBagName: 'errors',
fieldsBagName: 'fields',
delay: 100,
locale: 'zh_CN',
strict: true,
enableAutoClasses: true,
events: 'blur',
inject: true
};
// Custom prompt information
const dictionary = {
zh_CN: {
messages: {
ip: () => 'ip format is incorrect
The above is the detailed content of How to use Vee-Validate. For more information, please follow other related articles on the PHP Chinese website!