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

共n级台阶,每次可以上1级或2级台阶,有多少种上法?

【观察】超聚变:首提“算网九阶”评估模型,共建开放繁荣的算力网络

全网没有之一的JMeter 接口测试流程详解

千兆2光8电管理型工业以太网交换机WEB管理X-Ring一键环网交换机

基于Qt的目录统计QDirStat

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

瑞能微计量芯片RN2026的实用程序

KingbaseES数据库启动失败,报“内存段超过可用内存”

In a more general sense, calculating the displacement distance and assumptions

Brush esp8266-01 s firmware steps
随机推荐
如果禁用了安全启动,GNOME 就会发出警告
Parquet encoding
QNX Hypervisor 2.2 user manual] 10.1 gm vdev options
小程序+新零售,玩转行业新玩法!
Flink原理流程图简单记录
Detailed analysis of scaffolding content
[Study Notes Dish Dog Learning C] Dynamic Memory Management
new Date将字符串转化成日期格式 兼容IE,ie8如何通过new Date将字符串转化成日期格式,js中如何进行字符串替换, replace() 方法详解
Dong mingzhu live cold face away, when employees frequency low-level mistakes, no one can understand their products
LeetCode:899. 有序队列【思维题】
2022.8.3-----leetcode.899
Pine Script | How to display and typeset a plot switch?
STM32-遥感数据处理
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
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
案例 | 重庆银行流动数据安全挑战及应对实践
第08章 索引的创建与设计原则【2.索引及调优篇】【MySQL高级】
There are too many systems, how to realize multi-account interworking?
共n级台阶,每次可以上1级或2级台阶,有多少种上法?
复制带随机指针的链表