当前位置:网站首页>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.
边栏推荐
猜你喜欢

倒计时2天,“文化数字化战略新型基础设施暨文化艺术链生态建设发布会”启幕在即

第08章 索引的创建与设计原则【2.索引及调优篇】【MySQL高级】

Simple record of Flink principle flow chart

MySQL高级-读写分离-分库分表

Architecture of the actual combat camp module three operations

脚手架内容详解分析

activiti流程执行过程中,数据库表的使用关系

C language -- ring buffer

STM8S105k4t6c--------------点亮LED

小程序+新零售,玩转行业新玩法!
随机推荐
Qt中对象树的机制介绍以及底层实现,各种结果分析:(以及自己写容易犯错的点)
Oracle迁移到瀚高之后,空值问题处理
关联接口测试
Simple record of Flink principle flow chart
Polygon zkEVM网络节点
移动端响应式适配的方法
数据安全峰会2022 | 美创DSM获颁“数据安全产品能力验证计划”评测证书
Dong mingzhu live cold face away, when employees frequency low-level mistakes, no one can understand their products
sqoop ETL工具
出海季,互联网出海锦囊之本地化
如果禁用了安全启动,GNOME 就会发出警告
Exclude_reserved_words 排除关键字
C语言--环形缓存区
一个属于程序员的七夕节!
[Playwright Test Tutorial] 5 minutes to get started
一文看懂推荐系统:召回05:矩阵补充、最近邻查找,工业界基本不用了,但是有助于理解双塔模型
云开发旅游打卡广场微信小程序源码(含视频教程)
2022广东省安全员A证第三批(主要负责人)考试题库及模拟考试
瑞能微计量芯片RN2026的实用程序
系统太多,多账号互通如何实现?