Element-ui中ref和scope的使用

ref一般写在el-form中,以作为验证表单时使用

    :model="ruleForm"
    :rules="rules"
    ref="ruleForm"
    label-width="250px"
    class="demo-ruleForm"
  >


在调接口前作验证
this.$refs[formName].validate(valid => {

    if (valid) {
      console.log("11");
      upDataPc(updateAddinfo).then(res => {
          this.resetForm(formName);
          this.$message.success("修改批次成功");
          this.addBatchDialog = false;
          this.getBatchList();
      });

在el-table-column中可以添加template插槽通过scped.row加属性拿到data中的对应数据

 
    
  
  
  
  
    
  

你可能感兴趣的:(vue-cli,element)