当前位置:网站首页>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.
边栏推荐
- 多线程间的通信方式你知道几种?
- MySQL查询优化与调优
- 复制带随机指针的链表
- activiti流程执行过程中,数据库表的使用关系
- Good bosses, please ask the flink CDC oracle to Doris, found that the CPU is unusual, a run down
- flinkcdc 消费 mysql binlog 没有 sqltype=delete 的数据是什么原
- [QNX Hypervisor 2.2用户手册]10.3 vdev gic
- 基于Qt的目录统计QDirStat
- MallBook 助力SKT思珂特教育集团,立足变化,拥抱敏捷交易
- Asynchronous programming solution Generator generator function, iterator iterator, async/await, Promise
猜你喜欢
new Date将字符串转化成日期格式 兼容IE,ie8如何通过new Date将字符串转化成日期格式,js中如何进行字符串替换, replace() 方法详解
小程序+新零售,玩转行业新玩法!
Pine Script | How to display and typeset a plot switch?
6口全千兆二层网管型工业以太网交换机千兆2光4电光纤自愈ERPS环网交换机
Pine脚本 | 如何显示和排版绘图开关?
编写 BOLL 心得体会
Rongyun "Audio and Video Architecture Practice" technical session [complete PPT included]
2022年T电梯修理考题及答案
MySQL查询优化与调优
Development of Taurus. MVC WebAPI introductory tutorial 1: download environment configuration and operation framework (including series directory).
随机推荐
MySQL 查询练习(1)
TOML配置文件格式,YAML最有力的竞争者
STM8S-----option byte
数据湖(二十):Flink兼容Iceberg目前不足和Iceberg与Hudi对比
2022G1工业锅炉司炉考试练习题及模拟考试
自制蓝牙手机app控制stm8/stm32/C51板载LED
SQL注入中 #、 --+、 --%20、 %23是什么意思?
Brush esp8266-01 s firmware steps
STM8S105K4T6------Serial port sending and receiving
MallBook联合人民交通出版社,推动驾培领域新发展,开启驾培智慧交易新生态
【观察】超聚变:首提“算网九阶”评估模型,共建开放繁荣的算力网络
STM8S105k4t6c--------------点亮LED
Pine Script | How to display and typeset a plot switch?
QNX Hypervisor] 10.2 vdev 8259 2.2 user manual
Parquet encoding
SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropri
TOML configuration file format, YAML's top contender
Oracle迁移到瀚高之后,空值问题处理
各位大佬好,麻烦问一下flink cdc oracle写入doris的时候,发现cpu异常,一下下跑
Utilities of Ruineng Micrometer Chip RN2026