根据elementUI自定义校验方法

2023-12-29 11:56:12

首先是html

<el-form :inline='true' v-if="formData.airSwitchType == '4' || formData.airSwitchType == '3'"
                 :model='alarm_threshold' size='mini' class='line-set'>
          <div class='border-set' v-for='(it, i) in alarm_threshold.voltage_under' :key="getKey('a', i)">
            <el-form-item :label="getLevelText('欠压', i, '报警值:')" required>
              <el-input v-model='it.voltage_under'></el-input>
              伏
            </el-form-item>
            <el-form-item label='稳定时间:'>
              <el-input v-model='it.voltage_under_time'></el-input>
              秒
            </el-form-item>
            <el-form-item label='动作:' v-if="formData.airSwitchType == '4'">
              <el-radio-group v-model='it.voltage_under_do'>
                <el-radio :label='1'>断电</el-radio>
                <el-radio :label='0'>不断电</el-radio>
              </el-radio-group>
            </el-form-item>
            <i class='el-icon-circle-plus-outline' @click="addAlarm('voltage_under')" v-if='i == 0'></i>
            <i class='el-icon-remove-outline' @click="delAlarm('voltage_under', i)" v-if='i != 0'></i>
          </div>
          <br />
          <div class='border-set' v-for='(it, i) in alarm_threshold.voltage_over' :key="getKey('b', i)">
            <el-form-item :label="getLevelText('过压', i, '报警值:')" required>
              <el-input v-model='it.voltage_over'></el-input>
              伏
            </el-form-item>
            <el-form-item label='稳定时间:'>
              <el-input v-model='it.voltage_over_time'></el-input>
              秒
            </el-form-item>
            <el-form-item label='动作:' v-if="formData.airSwitchType == &#

文章来源:https://blog.csdn.net/qq_33911541/article/details/135284982
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。