当前位置:网站首页>Basic form validation process
Basic form validation process
2022-08-04 03:04:00 【I must win this time】
One. Basic form validation
1.el-form binding
model:binding data
rules: validation rules
ref='form' is used to get the instance object of el-form
2.el-fom-item
prop='the field name that needs to be validated'
rules:{
The value corresponding to prop:[
{required:true,message:"Error message",trigger:"change/blur"},
{min: minimum length, max: maximum length, message: "error message", trigger: "change/blur"}
{
Custom Rules:
validator:(rule,value,callback)=>{
rule:rule
value: The value of the current verification item
callback:callback function
Verification successful: callback()
Verification failed: callback(new Error('error message'))
} ,
trigger:"change/blur"
}
]
}
2. Global form validation
el-form ref="form"
this.$refs.form.validate((result)=>{
result:true validation succeeded
false: validation failed
})
Three. The code shines into reality
Submit 


These are some basic form validations for Ele.me, I hope they can help you.
边栏推荐
- sqoop ETL工具
- Big guys, it takes a long time to read mysql3 million single tables, what parameters can be discounted, or is there any way to hurry up
- MCU C language -> usage, and meaning
- QNX Hypervisor 2.2用户手册]10.2 vdev 8259
- Presto中broadcast join和partition join执行计划的处理过程
- 案例 | 重庆银行流动数据安全挑战及应对实践
- docker+网桥+redis主从+哨兵模式
- 云开发旅游打卡广场微信小程序源码(含视频教程)
- STM8S105k4t6c--------------点亮LED
- 自制蓝牙手机app控制stm8/stm32/C51板载LED
猜你喜欢

There are too many systems, how to realize multi-account interworking?

mpf5_定价Bond_yield curve_Spot coupon_duration_有效利率_连续复利_远期_Vasicek短期_CIR模型Derivatives_Tridiagonal_ppf

复制带随机指针的链表
编写 BOLL 心得体会

如果禁用了安全启动,GNOME 就会发出警告

Architecture of the actual combat camp module three operations

sqoop ETL tool

基于Qt的目录统计QDirStat

参加Oracle OCP和MySQL OCP考试的学员怎样在VUE预约考试

织梦响应式酒店民宿住宿类网站织梦模板(自适应手机端)
随机推荐
unsafe.Pointer, pointer, reference in golang
Exclude_reserved_words 排除关键字
Mockito单元测试
WPE详细教程
golang中的unsafe.Pointer,指针,引用
STM8S105K4T6------串口发送和接收
View mysql deadlock syntax
一个属于程序员的七夕节!
In a more general sense, calculating the displacement distance and assumptions
安装postgis时报找不到“POSTGIS_VERSION”这个函数
【学习笔记之菜Dog学C】动态内存管理
Qt中对象树的机制介绍以及底层实现,各种结果分析:(以及自己写容易犯错的点)
C语言--环形缓存区
ant-design的Select组件采用自定义后缀图标(suffixIcon属性)时,点击该自定义图标没有反应,不会展示下拉菜单的问题
共n级台阶,每次可以上1级或2级台阶,有多少种上法?
Ant - the design of the Select component using a custom icon (suffixIcon attribute) suffixes, click on the custom ICONS have no reaction, will not display the drop-down menu
为什么用Selenium做自动化测试
织梦内核电动伸缩门卷闸门门业公司网站模板 带手机版【站长亲测】
C# 构造函数业务场景测试项目
Zabbix设置邮件告警+企业微信告警