当前位置:网站首页>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 .
边栏推荐
- What are the common proxy servers and what are the differences?
- Use usedeferredvalue for asynchronous rendering
- MMSegmentation系列之训练与推理自己的数据集(三)
- Golang configure export goprivate to pull private library code
- 只需简单几步 - 开始玩耍微信小程序
- Qualcomm platform wifi-- WPA_ supplicant issue
- Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
- 2022-2028 global aluminum beverage can coating industry research and trend analysis report
- Which brand of running headphones is good? How many professional running headphones are recommended
- buu_ re_ crackMe
猜你喜欢

Special symbols in SAP ui5 data binding syntax, and detailed explanation of absolute binding and relative binding concepts

2022-2028 global soft capsule manufacturing machine industry research and trend analysis report

Formatting logic of SAP ui5 currency amount display

Golang configure export goprivate to pull private library code

多线程查询,效率翻倍

Systemserver service and servicemanager service analysis
![[staff] the direction of the symbol stem and the connecting line (the symbol stem faces | the symbol stem below the third line faces upward | the symbol stem above the third line faces downward | the](/img/fe/d97b25f702bbc05f941d08147259e0.jpg)
[staff] the direction of the symbol stem and the connecting line (the symbol stem faces | the symbol stem below the third line faces upward | the symbol stem above the third line faces downward | the

Render header usage of El table

Delphi xe10.4 installing alphacontrols15.12

結婚後
随机推荐
The number one malware in January 2022: lokibot returned to the list, and emotet returned to the top
Calculation of page table size of level 2, level 3 and level 4 in protection mode (4k=4*2^10)
Gradle 笔记
MMSegmentation系列之训练与推理自己的数据集(三)
设置状态栏颜色
Which brand of sports headset is better? Bluetooth headset suitable for sports
Ten minutes will take you in-depth understanding of multithreading - multithreaded teamwork: synchronous control
实现一个自定义布局的扫码功能
Start a business
Multi threaded query, double efficiency
Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]
Provincial election + noi Part IV graph theory
Face++ realizes face detection in the way of flow
Mongodb non relational database
QT实现界面跳转
QT environment generates dump to solve abnormal crash
2022-2028 global nano abrasive industry research and trend analysis report
GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面
2022-2028 global aluminum beverage can coating industry research and trend analysis report
Just a few simple steps - start playing wechat applet