当前位置:网站首页>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 .
边栏推荐
- Which brand of sports headset is better? Bluetooth headset suitable for sports
- STM32__05—PWM控制直流电机
- 【JVM】创建对象的流程详解
- tarjan2
- 设置状态栏颜色
- 2022 low voltage electrician test question simulation test question bank simulation test platform operation
- New programmer magazine | Li Penghui talks about open source cloud native message flow system
- Baohong industry | what misunderstandings should we pay attention to when diversifying investment
- 超图iServer rest服务之feature查询
- Common means of modeling: aggregation
猜你喜欢
![[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)

Verilog 时序控制
![[staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)](/img/e0/05890eafdb291c5aaff78cc241f455.jpg)
[staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)

verilog 并行块实现

浅谈线程池相关配置

数据传输中的成帧

2022-2028 global deep sea generator controller industry research and trend analysis report

SAP ui5 beginner tutorial 19 - SAP ui5 data types and complex data binding

Mongodb base de données non relationnelle

Multi threaded query, double efficiency
随机推荐
[JSON] gson use and step on the pit
Connected block template and variants (4 questions in total)
Face++ realizes face detection in the way of flow
Redis set command line operation (intersection, union and difference, random reading, etc.)
2022-2028 global military computer industry research and trend analysis report
多线程查询,效率翻倍
【做题打卡】集成每日5题分享(第二期)
[learn C and fly] 4day Chapter 2 program in C language (exercise 2.5 generate power table and factorial table
创业了...
STM32__ 05 - PWM controlled DC motor
Just a few simple steps - start playing wechat applet
Design details of SAP e-commerce cloud footernavigationcomponent
实现一个自定义布局的扫码功能
Rotating frame target detection mmrotate v0.3.1 learning model
[road of system analyst] collection of wrong topics in enterprise informatization chapter
Formatting logic of SAP ui5 currency amount display
[staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)
How to create an instance of the control defined in SAP ui5 XML view at runtime?
ZABBIX API creates hosts in batches according to the host information in Excel files
批量检测url是否存在cdn—高准确率