Vue.js uses the computed attribute to automatically sum, how to display the corresponding value range under each input box?

Xiaobai, recently in the study vue.js, wrote 3 input boxes to do automatic summation, and now it is possible to do automatic summation for the first column input box. Now think of a requirement and display the corresponding value range at the bottom of each input box, as shown in the following figure:

in this way, we can know the interval range of each group, for example, the first group is in [0 ~ 10%) and the second group is in [10 ~ 30%).
I don"t have any ideas right now, so I have written some code as follows:

<template>
  <div id="app">
    <form action="" :model="inputValues">
      <br>
      <span>Total Percentage: {{sum}}</span>
      <div v-for="item in inputValues">
        <br>
        <input type="text" v-model="item.percentage" placeholder="percentage">
        <input type="text" v-model="item.group" placeholder="group">
        <br><br>
        //
        //{{sum}}
        <span> [{{previous_sum}}% ~ {{sum}}%)</span>
      </div>
    </form>

  </div>
</template>

<script>
    export default {
      data() {
        return {
          inputValues: [
            {
              percentage:"",
              group:""
            },
            {
              percentage:"",
              group:""
            },
            {
              percentage:"",
              group:""
            }
          ]
        }
      },
      computed: {
      //
        sum() {
          return  this.inputValues.reduce((total,value) => {
            return Number.isNaN(parseFloat(value.percentage)) ?
              total :
              total + parseFloat(value.percentage)
          },0);
        },
        

        //
        // previous_sum = sum - current_inputValues
        // = - 
        // 
        previous_sum(){
          var previous_sum = 0;
          this.inputValues.forEach((item)=>{
            previous_sum = sum - parseFloat(item.percentage);
          })
        }
      }
    }
</script>

Please give us some advice on how to modify the code in this situation. My brother"s foundation is weak. Please give me more advice. Thank you

Mar.09,2021

// template
<div v-for="(item, index) in inputValues"> <!-- vue1.0itemindex(index, item) -->
    <br>
    <input type="text" v-model="item.percentage" placeholder="percentage">
    <input type="text" v-model="item.group" placeholder="group">
    <br><br>
    <span> {{ format(index) }}</span>
</div>

// script
methods: {
    format (index) {
        let p = 0
        let val = this.inputValues
        for (let i = 0; i < index; iPP) {
            let cur = val[i].percentage
            if (!Number.isNaN(parseFloat(cur))) {
                p += parseFloat(cur)
            }
        }
        let a = p
        let cur = val[index].percentage
        if (!Number.isNaN(parseFloat(cur))) {
            a += parseFloat(cur)
        }
        return `[${p}%~${a}%)`
    }
}

this logic cannot be solved by a calculation attribute, because for three data, either three calculation attributes are used, and it is not necessary to
or use a method to pass parameters in

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36932-2c01a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36932-2c01a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?