当前位置:网站首页>El form form verification
El form form verification
2022-06-13 06:15:00 【A strong foam】
problem
Modify options 1 The content in , Still show “ Please enter voting options ”, Invalid verification :
Code :
reason
prop
Attributes need to be associated with el-input The binding of v-model="item.polloption"
Value consistent .
voteForm The data structure is as follows ,
So options input The calibration of shall be maintained options.0.polloption'
、options.1.polloption'
And so on .
If the modification is not completely consistent , The following code :prop="'options11.' + index + '.polloption'"
You will also report mistakes. , Because it shouldn't be options11
,
<el-form-item
v-for="(item, index) in voteForm.options"
class="vote-item"
:prop="'options11.' + index + '.polloption'"
:label="' Options ' + (index+1) + ':'"
:key="index"
:rules="[
{
required: true, message: ' Please enter voting options ', trigger: 'blur' }
]"
>
An error is as follows :
solve
Add
In addition to the Form In addition to passing all the validation rules on the component at one time, you can also pass the validation rules of attributes on a single form field . As shown in the figure above ,el-form You do not need to set :rules="rules"
, Directly in el-form-item Set in :rules="[ { required: true, message: ' Please enter voting options ', trigger: 'blur' } ]"
that will do .
Reference resources : el-form Add or delete form items dynamically 、async-validator
边栏推荐
- A glimpse of [wechat applet]
- JS to realize bidirectional data binding
- Printf function
- Uniapp hides the scroll bar of scroll view
- A brief analysis of the overall process of view drawing
- Echart histogram: stacked histogram displays value
- USB 0xc0000011 error
- Test logiciel - résumé des FAQ d'interface
- 自定义View
- The difference between the increment and decrement operators before and after variables i+, +i, I –, – I
猜你喜欢
Huawei developer certification and deveco studio compiler Download
Wechat applet (get location)
本地文件秒搜工具 Everything
AI realizes "Resurrection" of relatives | old photo repair | old photo coloring, recommended by free app
1+1>2,Share Creators可以帮助您实现
Echart柱状图:x轴显示value,y轴显示类别
Echart柱状图:echart实现堆叠柱状图
免费录屏软件Captura下载安装
Echart折线图:当多条折线存在相同name,图例仍全部显示
Intelligent digital asset management helps enterprises win the post epidemic Era
随机推荐
Fragment lifecycle
Annotation only integration SSM framework
USB debugging assistant
超有范的 logo 在线设计制作工具
【js】var、let、const
杨辉三角形详解
Wechat applet: basic review
[turn] explain awk (1)__ Awk Basics_ Options_ Program segment parsing and examples
Echart折线图:当多条折线图的name一样时也显示不同的颜色
Waterfall flow layout of uni app Homepage
Echart柱状图:echart实现堆叠柱状图
Free screen recording software captura download and installation
Cmake add -fpic option GCC
MySQL stored procedure
pthon 执行 pip 指令报错 You should consider upgrading via ...
Uniapp hides the scroll bar of scroll view
Complete USB debugging assistant
Alibaba cloud OSS file download cannot be resumed at a breakpoint
Hbuilderx: installation of hbuilderx and its common plug-ins
Echart histogram: X-axis displays value, Y-axis displays category