Element form calculation synthesis, how to invoke the results in other locations.

I can get the overall value obtained by the calculated list in the list, but I don"t know how to call it in other functions.

I want to get the value in the red box, clipboard.png

clipboard.png


clipboard.png

Mar.22,2021

data is easy to get in vue. You can define the variable sums directly in data

.
data{
    return{
        sums:0
    }
}

then use this.sums to get the value
the data in your loop may be complicated, but the idea is like this
or you make a decision in the function to assign it to another variable

.
//sums[index]
if(column.property=='proportion'){
    this.total=sums[index] //
}
//

is just a train of thought, do not spray if there is a mistake

Menu