前端实现动态模板框添加信息(ElementUI动态增减表多项)

  • Post author:
  • Post category:其他




在新增修改中需要多添加多成员信息,用ElementUI动态增减表多项来实现

效果展示:

在这里插入图片描述

<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
  <el-form-item
    prop="email"
    label="邮箱"
    :rules="[
      {
    required: true, message: '请输入邮箱地址', trigger: 'blur' },
      {
    type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
    ]"
  >
    <el-input v-model="dynamicValidateForm.email"></el-input>
  </el-form-item>
  <el-form-item
    v-for="(domain, index) in dynamicValidateForm.domains"
    :label="'域名' + index"
    :key="domain.key"
    :prop="'domains.' + index + '.value'"
    :rules="{
   
      required: true, message: '域名不能为空', trigger: 'blur'
    }"
  >
    <el-input v-model="domain.value"></el-input><el-button @click.prevent="removeDomain(domain)">删除</el-button>
  </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="submitForm('dynamicValidateForm')">提交</el-button>
    <el-button @click="addDomain">新增域名</el-button>
    <el-button @click=



版权声明:本文为weixin_44635778原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。