Home  >  Article  >  Web Front-end  >  How to use Vee-Validate

How to use Vee-Validate

小云云
小云云Original
2018-02-03 13:41:391678browse

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

vue code:


##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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn