Closed p0sidonz closed 2 years ago
You may try this alternative way to define the jsondata:
data () {
return {
jsondata: [{
employeeId: 123,
name: 'John wick',
daysWorked: 30
perDayWages: 3000,
get total () {
return this.daysWorked * this.perDayWages
}
}, {
employeeId: 124,
name: 'kratos',
daysWorked: 15
perDayWages: 3000,
get total () {
return this.daysWorked * this.perDayWages
}
}]
}
}
Oh! Never thought of doing this. Thank you very much! <3
I have a simple jsondata file which i am showing, I have to sum every rows horizontally. But how do i get the each object so that i can add my logic to the 'TOTAL' column for each rows?