当前位置:网站首页>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
边栏推荐
- 安全基线检查脚本—— 筑梦之路
- Custom view - extensible collapsexpendview
- Huawei developer certification and deveco studio compiler Download
- 不在以下合法域名列表中,微信小程序解决办法
- Intelligent digital asset management helps enterprises win the post epidemic Era
- Time conversion'2015-04-20t11:12:00.000+0000 '
- Waterfall flow layout of uni app Homepage
- Uni app dynamic setting title
- The title of the WebView page will be displayed in the top navigation bar of the app. How to customize
- Super model logo online design and production tool
猜你喜欢
随机推荐
[JS] array de duplication
智能数字资产管理助力企业决胜后疫情时代
Uniapp mobile terminal uses canvas to draw background convex arc
Leetcode perfect number simple
[MySQL] basic knowledge review
Rk3399 hid gadget configuration
安全基线检查脚本—— 筑梦之路
Fichier local second Search Tool everything
Echart histogram: stacked histogram displays value
Detailed explanation of Yanghui triangle
Leetcode- reverse string ii- simple
JVM基础
HBuilderX:HBuilderX安装以及其常用插件安装
Intelligent digital asset management helps enterprises win the post epidemic Era
The SQL file of mysql8.0 was imported into version 5.5. There was a pit
【var const let区别】
不在以下合法域名列表中,微信小程序解决办法
MySQL trigger
1+1 > 2, share creators can help you achieve
Uni app upload file









