el-table中增加校验方法(二)

思路:element-ui组件中是自带from校验的,所以想校验表格可以在其外部封装一个from

javascript 复制代码
<template>
<el-form ref="formRef" :model="formData" :rules="formRules" :inline-message="true">
      <el-table
        :data="formData.mouldData"
        border
        stripe
        highlight-current-row
        :row-class-name="tableRowClassName"
        :cell-style="{ 'text-align': 'center' }"
        @row-click="handleRowClick"
        :header-cell-style="{
          background: '#b7babd',
          color: '#1e1f22',
          height: '35px',
          'text-align': 'center'
        }"
        style="width: 100%;max-height:45vh;overflow-y: auto"
        max-height="600"

      >
        <el-table-column label="序号" label-width="100px" type="index" />
        <el-table-column label="用户名称">
          <template #header> 用户名称</template>
          <template #default="scope">
            <el-form-item
              size="small"
              :prop="'mouldData.[' + scope.$index + '].evaluationProject'"
              :rules="formRules.evaluationProject"
              style="margin-top: 15px"
              v-show="scope.row.show"
            >
              <el-input v-model="scope.row.evaluationProject" size="large" @input="handleInput(scope.row)"/>
            </el-form-item>
            <span v-show="!scope.row.show">{{ scope.row.evaluationProject }}</span>
          </template>
        </el-table-column>
      </el-table>
      </el-form>
</template>
相关推荐
FanetheDivine5 小时前
总结近期关于Agent的思考和成果
javascript·agent·ai编程
Setsuna_F_Seiei6 小时前
性能优化 - 列表分页查询的优化
前端·vue.js·性能优化
Setsuna_F_Seiei6 小时前
性能优化 - Vue.js 的懒加载的优化封装
前端·vue.js·性能优化
狗头大军之江苏分军10 小时前
《潮水漫过十七岁》倒计时
前端·javascript·后端
小码哥06811 小时前
租房平台源码部署验收:房源样例、区域字典与看房预约逐项验证
前端·javascript·vue.js·租房小程序·租房系统·租房软件
htzyl20611 小时前
JS原型链与继承:class 底下到底是什么
前端·javascript·ecmascript 6
htzyl20611 小时前
JS-关于闭包捕获与释放
前端·javascript
狗头大军之江苏分军11 小时前
《潮水漫过十七岁》好久没写了
前端·javascript·后端
蔓越莓曲奇14 小时前
给 DeepSeek Harness 换上 GTA 6 皮肤:Agent 一干活,通缉星级就亮
前端·javascript·开源
KevinWang_14 小时前
iOS 开发计划(四) - 拆分模块
javascript