当前位置:网站首页>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 .
边栏推荐
- Feature query of hypergraph iserver rest Service
- The capacity is upgraded again, and the new 256gb large capacity specification of Lexar rexa 2000x memory card is added
- 2022-2028 global encryption software industry research and trend analysis report
- Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
- 結婚後
- Mongodb base de données non relationnelle
- Divorce for 3 years to discover the undivided joint property, or
- Render header usage of El table
- 数据传输中的成帧
- 4. Find the median of two positive arrays
猜你喜欢

Xiaomi, a young engineer, was just going to make soy sauce
![[learn C and fly] 1day Chapter 2 (exercise 2.2 find the temperature of Fahrenheit corresponding to 100 ° f)](/img/39/42b1726e5f446f126a42d7ac673dce.png)
[learn C and fly] 1day Chapter 2 (exercise 2.2 find the temperature of Fahrenheit corresponding to 100 ° f)

Feature query of hypergraph iserver rest Service

Verilog 过程连续赋值
![[staff] restore mark (Introduction to the use of restore mark | example analysis of Metaphone mark and restore mark)](/img/21/7bbf276b01f5a1056a22f5afc0af26.jpg)
[staff] restore mark (Introduction to the use of restore mark | example analysis of Metaphone mark and restore mark)
![[JSON] gson use and step on the pit](/img/86/6ee2971715e0d29008a4b7b1a7aa45.jpg)
[JSON] gson use and step on the pit

2022-2028 global wood vacuum coating machine industry research and trend analysis report

2022-2028 global aluminum beverage can coating industry research and trend analysis report

超图iServer rest服务之feature查询

GB/T-2423. XX environmental test documents, including the latest documents
随机推荐
CoordinatorLayout + TabLayout + ViewPager2(里面再嵌套一个RecyclerView),RecyclerView的滑动冲突解决
Yyds dry goods inventory accelerating vacuum in PG
竞争与冒险 毛刺
[untitled]
Gradle 笔记
[JS reverse series] analysis of a customs publicity platform
Unit · elementary C # learning notes
批量检测url是否存在cdn—高准确率
Qualcomm platform wifi-- WPA_ supplicant issue
[staff] restore mark (Introduction to the use of restore mark | example analysis of Metaphone mark and restore mark)
verilog 并行块实现
OSPF LSA message parsing (under update)
高并发场景下缓存处理方案
Stdref and stdcref
2022安全员-C证考试题及模拟考试
What kind of good and cost-effective Bluetooth sports headset to buy
[learn C and fly] day 5 chapter 2 program in C language (Exercise 2)
MMSegmentation系列之训练与推理自己的数据集(三)
Which brand of sports headset is better? Bluetooth headset suitable for sports
浅谈线程池相关配置