当前位置:网站首页>el form 表单validate成功后没有执行逻辑
el form 表单validate成功后没有执行逻辑
2022-07-02 05:06:00 【进击的yuan人】
form 表单validate成功后没有执行逻辑
01.问题分析
1.验证表单不通过的时候会执行提示,通过后没有执行任何逻辑,如下图所示

2.按正确逻辑,控制台会输出success,但是验证通过后没有执行任务逻辑,因此得出是验证规则通过后的方法返回问题
02.查看已有规则
1.查看form表单rules逻辑,如下图所示

2.图中对年龄进行验证,为空值进行提示
3.很多时候都觉得这样验证时没有问题的,但是这里只执行了错误的逻辑,没有执行正确的逻辑,所以存在值得情况下需要执行正确的逻辑
03.问题解决
1.在验证方法添加正确的处理逻辑,如下图所示

2.图中添加了callbak()方法,用于验证通过后的逻辑执行
注意
1.所有自定义验证规则的方法,任何(情况)下都需要执行callback()方法
边栏推荐
- Briefly introduce chown command
- paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
- Video cover image setting, put cover images into multiple videos in the simplest way
- There are duplicate elements in leetcode. Go implementation
- DJB Hash
- The underlying principle of go map (storage and capacity expansion)
- 函数中使用sizeof(arr) / sizeof(arr[0])求数组长度不正确的原因
- 数学问题(数论)试除法做质数的判断、分解质因数,筛质数
- Mathematical knowledge -- understanding and examples of fast power
- The reason why sizeof (ARR) / sizeof (arr[0]) is used in the function to calculate the length of the array is incorrect
猜你喜欢

Embedded-c language-8-character pointer array / large program implementation

Common errors of dmrman offline backup

LeetCode 241. 为运算表达式设计优先级(分治/记忆化递归/动态规划)
![[opencv] image binarization](/img/7e/b56a59ffae3bf6cac9c0bb7e090b85.jpg)
[opencv] image binarization

How to write a client-side technical solution

TypeScript函数详解

洛谷入门3【循环结构】题单题解
![Introduction to Luogu 3 [circular structure] problem list solution](/img/fd/c0c5687c7e6e74bd5c911b27c3e19c.png)
Introduction to Luogu 3 [circular structure] problem list solution

LeetCode 1175. 质数排列(质数判断+组合数学)

正大美欧4的主账户关注什么数据?
随机推荐
Map in JS (including leetcode examples)
Pytest learning ----- pytest Interface Association framework encapsulation of interface automation testing
数学知识(欧拉函数)
Analyzing the hands-on building tutorial in children's programming
在{{}}中拼接字符
Set the default style of scroll bar Google browser
Rhcsa --- work on the fourth day
Find the subscript with and as the target from the array
There are duplicate elements in leetcode. Go implementation
Mathematical knowledge -- understanding and examples of fast power
Implementation of go language for deleting duplicate items in sorting array
Unity particle Foundation
C# 基于MQTTNet的服务端与客户端通信案例
06 装饰(Decorator)模式
Summary of main account information of zhengdaliu 4
Getting started with pytest ----- confitest Application of PY
win10 磁盘管理 压缩卷 无法启动问题
Briefly introduce chown command
Pycharm breakpoint management: temporarily cancel some breakpoints + run directly to a line
Application of intelligent robot in agricultural ecology