当前位置:网站首页>Form custom verification rules
Form custom verification rules
2022-07-02 03:03:00 【Galloping Campbell cat】
Form custom verification rules
Looking at vue-element-admin When I learned element Medium Custom validation rules . Record it here .
Just start , To achieve the function , The following points need to be achieved Bind form , And implement validation rules
1. Complete the binding of forms and rules
Forms :
stay el-from Bind the rules for each form in the whole ,
And for every form item binding prop Used to determine which validation rule to use

Here are the defined rules .
In the form prop And the corresponding here ,
You can see that there is validator This one . The following is the method of definition
2. Complete the definition of the verification function

This check function needs to be defined in data Non - return in
Function composition :

among value and callback Most used
Explain my code :
validUsername.js:
When the verification will be carried out , take value Value , Pass in validUsername() Determine which step of the verification function to execute by the returned result , And execute the callback function .
After that, you can verify the form .
边栏推荐
- [staff] restore mark (Introduction to the use of restore mark | example analysis of Metaphone mark and restore mark)
- 2022安全员-C证考试题及模拟考试
- buu_ re_ crackMe
- Mongodb non relational database
- C shallow copy and deep copy
- Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
- MongoDB非關系型數據庫
- Learning notes of software testing -- theoretical knowledge of software testing
- 2022-2028 global military computer industry research and trend analysis report
- Provincial election + noi Part IV graph theory
猜你喜欢

Delphi xe10.4 installing alphacontrols15.12

QT environment generates dump to solve abnormal crash

MVVM and MVC

Multi threaded query, double efficiency

连通块模板及变式(共4题)

JS introduction < 1 >
![Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]](/img/9b/3c001c3b86ca3f8622daa7f7687cdb.png)
Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]

Design details of SAP e-commerce cloud footernavigationcomponent
![[JVM] detailed description of the process of creating objects](/img/6e/0803b6b63c48337985faae8d5cbe1a.png)
[JVM] detailed description of the process of creating objects

表单自定义校验规则
随机推荐
2022-2028 global nano abrasive industry research and trend analysis report
QT使用sqllite
Rotating frame target detection mmrotate v0.3.1 learning model
超图iServer rest服务之feature查询
Unit · elementary C # learning notes
[Chongqing Guangdong education] Sichuan University concise university chemistry · material structure part introductory reference materials
Pychart creates new projects & loads faster & fonts larger & changes appearance
Analysis of FLV packaging format
MongoDB非关系型数据库
Mathematics in Sinorgchem: computational geometry
2022-2028 global human internal visualization system industry research and trend analysis report
buu_ re_ crackMe
Multi threaded query, double efficiency
How to create an instance of the control defined in SAP ui5 XML view at runtime?
【JVM】创建对象的流程详解
Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]
Actual battle of financial risk control - under Feature Engineering
Soul app released the annual report on generation Z behavior: nearly 20% of young people love shopping in the vegetable market
QT environment generates dump to solve abnormal crash
[JS reverse series] analysis of a customs publicity platform