当前位置:网站首页>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>
边栏推荐
- Spanner 论文小结
- More than one file was found with OS independent path ‘lib/armeabi-v7a/libyuv. so‘.
- 点赞的云函数
- Like cloud functions
- Application and principle of ThreadPoolExecutor thread pool
- Use and principle of Park unpark
- Leetcode316- remove duplicate letters - stack - greedy - string
- 【暑期每日一题】洛谷 P2637 第一次,第二次,成交!
- C WPF uses dockpanel to realize screenshot box
- Detailed explanation of distributed global unique ID solution
猜你喜欢

How to hide browser network IP address and modify IP internet access?

0xc000007b应用程序无法正常启动解决方案(亲测有效)

Thread process foundation of JUC

Manually implement a simple stack

液压滑环的特点讲解

Design and application of immutable classes

How to meet the requirements of source code confidentiality and source code security management

Tcp/ip explanation (version 2) notes / 3 link layer / 3.2 Ethernet and IEEE 802 lan/man standards

Causes of short circuit of conductive slip ring and Countermeasures

C# wpf 使用DockPanel实现截屏框
随机推荐
Receiving package install and uninstall events
[NLP Li Hongyi] notes
AcWing 887. Finding combinatorial number III (Lucas theorem)
对象的序列化与反序列化
Use of STM32 expansion board temperature sensor and temperature humidity sensor
Global and Chinese market of paper machine systems 2022-2028: Research Report on technology, participants, trends, market size and share
Use and principle of AQS related implementation classes
Solution: thread 1:[< *> setvalue:forundefined key]: this class is not key value coding compliant for the key*
Data consistency between redis and database
Serialization and deserialization of objects
FileOutPutStream
Unit testing with mongodb
Several methods of creating thread classes
How to start learning editing? Detailed analysis of zero basis
Flutter 实现每次进来界面都刷新数据
AcWing 885. Find the combination number I (recursive preprocessing)
液压滑环的特点讲解
0xc000007b应用程序无法正常启动解决方案(亲测有效)
[hard ten treasures] - 2 [basic knowledge] characteristics of various topological structures of switching power supply
使用 Nocalhost 开发 Rainbond 上的微服务应用

