<el-form-item label="实际扣分:" style="color: red" >
              <el-input v-model="item.deductPoints" placeholder="请输入分数" v-on:input="search" />
            </el-form-item>

监听方法需要使用v-on:input="“方法名”

    search(e){
      var count = 0;
      for (var i = 0; i < this.ScoreInfo.length; i++) {
        //  这里将数组中的字符串转换为数字,乘以1就可以
        count = count + this.ScoreInfo[i].deductPoints * 1
      }
      this.form.fraction = count;
    },

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐