博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vue 使用 element ui动态添加表单
阅读量:4607 次
发布时间:2019-06-09

本文共 1274 字,大约阅读时间需要 4 分钟。

html部分

删除
提交
新增域名
重置

js部分

export default {  name: "fromdatadt",  data() {    return {      dynamicValidateForm: {        domains: [          {            name: "",            age: "",            six: ""          }        ],        email: "",        qq: "",        tel: ""      }    };  },  methods: {    submitForm(formName) {      console.log(JSON.stringify(this.dynamicValidateForm));    },    resetForm(formName) {      this.$refs[formName].resetFields();    },    removeDomain(item) {      var index = this.dynamicValidateForm.domains.indexOf(item);      if (index !== -1) {        this.dynamicValidateForm.domains.splice(index, 1);      }    },    addDomain() {      this.dynamicValidateForm.domains.push({        name: "",        age: "",        six: "",        key: Date.now()      });    }  }};

提交如下:

转载于:https://www.cnblogs.com/aSnow/p/10504605.html

你可能感兴趣的文章
CSS3 新属性兼容性测试
查看>>
js闭包
查看>>
Oralce导入数据库出现某一列的值太大
查看>>
Union和Union All 的区别
查看>>
sql server 2005函数
查看>>
innotop
查看>>
jmeter 取样器--http请求详解
查看>>
【转载】Understanding the Objective-C Runtime
查看>>
aabb碰撞检测
查看>>
Xshell连接Linux
查看>>
了解JavaScript中的内置对象
查看>>
20180530
查看>>
项目复审——Alpha阶段
查看>>
React Native Windows下环境安装(一)
查看>>
文本CSS
查看>>
JDK1.7新特性,语言篇
查看>>
javaScript判断手机型号
查看>>
应用程序设计:图书管理系统模板(链表+文件)
查看>>
遗传算法学习--多目标优化中的遗传算法
查看>>
Git的安装和使用教程详解
查看>>