zoukankan      html  css  js  c++  java
  • 多层表单验证

    1.循环校验,每一项加 :prop和:rules

    2. 排除置灰项验证    :rules="!contentItem.isScoreTag?[]:formRules.isScoreTag"

    3.这种方式在失去焦点时不能触发校验,采用第二种增加父容器可解决

    1.  <el-form-item label="scoreType:"
                                  :prop="'contentList.'+index+'.scoreType'"
                                  :rules="!contentItem.isScoreTag?[]:formRules.isScoreTag">
                      <el-input v-model="contentItem.scoreType"
                                :disabled="!contentItem.isScoreTag"></el-input>
                    </el-form-item>
    
    

     可使用v-if,并多增加一层父容器 

     1  <el-col :span="8"
     2                           v-if="contentItem.tagType == 1201">
     3                     <div>
     4                       <el-form-item label="scoreType:"
     5                                     :prop="'content.' + index + '.scoreType'"
     6                                     :rules="formRules.scoreType">
     7                         <el-input v-model="contentItem.scoreType"
     8                                   :disabled="false"></el-input>
     9                       </el-form-item>
    10                     </div>
    11                   </el-col>
  • 相关阅读:
    SQL函数 Convert,dateadd
    WebBrowser.ExecWB的完整说明
    GetShortPathName函数
    winmm.dll包含函数
    C# 操作Excel大全
    C#操作目录和文件
    File操作
    C#中对EXCEL保存的SAVEAS方法说明
    dataTable 、dataView、Dataset 区别
    System.Windows.Forms.Application.DoEvents();
  • 原文地址:https://www.cnblogs.com/ihuangqing/p/11737110.html
Copyright © 2011-2022 走看看