当前位置:网站首页>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 .
边栏推荐
- Baohong industry | 6 financial management models at different stages of life
- Mongodb non relational database
- Cache processing scheme in high concurrency scenario
- Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
- 3048. Number of words
- STM32__ 05 - PWM controlled DC motor
- Connected block template and variants (4 questions in total)
- 只需简单几步 - 开始玩耍微信小程序
- Oracle creates a user with read-only permission in four simple steps
- [staff] restore mark (Introduction to the use of restore mark | example analysis of Metaphone mark and restore mark)
猜你喜欢

Discussion on related configuration of thread pool

只需简单几步 - 开始玩耍微信小程序

Analysis of FLV packaging format

Multi threaded query, double efficiency

Mongodb base de données non relationnelle
![寻找重复数[抽象二分/快慢指针/二进制枚举]](/img/9b/3c001c3b86ca3f8622daa7f7687cdb.png)
寻找重复数[抽象二分/快慢指针/二进制枚举]

连通块模板及变式(共4题)
![[staff] pitch representation (bass clef | C1 36 note pitch representation | C2 48 note pitch representation | C3 60 note pitch representation)](/img/98/956d8abbccceb1aae47e25825bc63d.jpg)
[staff] pitch representation (bass clef | C1 36 note pitch representation | C2 48 note pitch representation | C3 60 note pitch representation)

2022-2028 global nano abrasive industry research and trend analysis report

Systemserver service and servicemanager service analysis
随机推荐
【JVM】创建对象的流程详解
Addition without addition, subtraction, multiplication and division (simple difficulty)
Remote connection to MySQL under windows and Linux system
Use usedeferredvalue for asynchronous rendering
What is hybrid web containers for SAP ui5
JDBC details
How to create an instance of the control defined in SAP ui5 XML view at runtime?
[learn C and fly] 3day Chapter 2 program in C language (exercise 2.3 calculate piecewise functions)
CoordinatorLayout + TabLayout + ViewPager2(里面再嵌套一个RecyclerView),RecyclerView的滑动冲突解决
3048. Number of words
LeetCode刷题(十)——顺序刷题46至50
Verilog 时序控制
[learn C and fly] 2day Chapter 8 pointer (practice 8.1 password unlocking)
STM32__ 05 - PWM controlled DC motor
QT实现界面跳转
Multi threaded query, double efficiency
Yyds dry goods inventory accelerating vacuum in PG
Batch detect whether there is CDN in URL - high accuracy
After marriage
只需简单几步 - 开始玩耍微信小程序