In this table programmed in VUE 2 I want this result:
+-------------------------------------------+
| fact $importe $ acumula consecutivo |
+-------------------------------------------+
| 23 $ 350 $ 350 1 |
| 28 $ 200 $ 550 2 |
| 32 $ 300 $ 850 3 |
+-------------------------------------------+
this is my current code:
<tr v-for="movi in movimientos">
<td>{{movi.factura}}</td>
<td>{{movi.importe}}{{acumular(movi.importe)}}</td>
<td> {{saldo}} </td>
</tr>
How do I get the cumulative and the consecutive vue?
mounted(){
this.entrar();
},
data(){
return{
movimientos: null,
saldo: 0
}
},
methods:{
entrar(){
axios.get('miservidor/lee.php?idc='+this.id)
.then((respues) => {
this.movimientos = respues.data;
});
},
acumular(importe){
this.saldo = this.saldo + importe;
}
}