当前位置:网站首页>Dynamic verification of new form items in El form; El form verifies that the dynamic form V-IF does not take effect;
Dynamic verification of new form items in El form; El form verifies that the dynamic form V-IF does not take effect;
2022-07-01 05:17:00 【i_ am_ a_ div_ Accumulate over time_】
One 、 Add and delete form items , Dynamic verification .
el-form Forms dynamically add forms for verification . Direct reference Add or delete form items dynamically
Two 、el-form Form verification v-if Don't take effect 、el-form Form verification v-show Don't take effect :
For example, there are form items , Display the contents of two different form items through control , You need to verify the corresponding form items .
If it is used directly v-if, You will find that when switching , Verification does not take effect ;
If used directly v-show, And I found that even without switching , Other form items are hidden , Verification rules will also be triggered .
The right thing to do is : Use v-if Control the display and hiding of form items , At the same time, we need to give el-form-item Add your own prop=" " and key=" " , In this way, we can distinguish . Of course :rules You should also have your own corresponding prompt .
<template v-if="flag">
<el-form-item label=" full name :" prop="name" key="name" :rules="rules.name">
<el-input v-model="formData.name" placeholder=""></el-input>
</el-form-item>
</template>
<template v-else>
<el-form-item label=" Reasons for return :" prop="desc" key="desc" :rules="rules.desc">
<el-input type="textarea" maxlength="500" show-word-limit v-model="formData.desc" placeholder=" Please fill in the reason for return "></el-input>
</el-form-item>
</template>
边栏推荐
- [daily question in summer] first time, second time, deal!
- 0xc000007b应用程序无法正常启动解决方案(亲测有效)
- 轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
- Distributed transactions - Solutions
- [hard ten treasures] - 2 [basic knowledge] characteristics of various topological structures of switching power supply
- Thread process foundation of JUC
- 在Rainbond中一键部署高可用 EMQX 集群
- 导电滑环短路的原因以及应对措施
- [daily question in summer] letter delivery by p1629 postman in Luogu (to be continued...)
- 点赞的云函数
猜你喜欢

Unity drags and modifies scene camera parameters under the editor
![[RootersCTF2019]babyWeb](/img/b4/aa8f8e107a9dacbace72d4717b1834.png)
[RootersCTF2019]babyWeb

Solution: drag the Xib control to the code file, and an error setvalue:forundefined key:this class is not key value coding compliant for the key is reported

CockroachDB 分布式事务源码分析之 TxnCoordSender

Implementation of distributed lock

导电滑环短路的原因以及应对措施

tar命令

Spanner 论文小结
![[summer daily question] Luogu p5886 Hello, 2020!](/img/ac/4be05f80aab7fb766674e6e2d16fbc.png)
[summer daily question] Luogu p5886 Hello, 2020!
![Is there any good website or software for learning programming? [introduction to programming]?](/img/ae/68a5880f313c307880ac80bd200530.jpg)
Is there any good website or software for learning programming? [introduction to programming]?
随机推荐
HCIP Day13
AcWing 889. 01 sequence satisfying the condition (Cartland number)
Worried about infringement? Must share copyrightless materials on the website. Don't worry about the lack of materials for video clips
How to traverse massive data in redis
Vmware workstation network card settings and three common network modes
Distributed - summary list
Unit testing with mongodb
Query long transaction
Leetcode316- remove duplicate letters - stack - greedy - string
JS random verification code
Thread process foundation of JUC
Pytoch (III) -- function optimization
Design experience of Meizhou clinical laboratory
Design and application of immutable classes
Global and Chinese market of enterprise wireless LAN 2022-2028: Research Report on technology, participants, trends, market size and share
STM32 expansion board digital tube display
How to meet the requirements of source code confidentiality and source code security management
FileOutPutStream
Global and Chinese market for instant messaging security and compliance solutions 2022-2028: Research Report on technology, participants, trends, market size and share
Use of STM32 expansion board temperature sensor and temperature humidity sensor

