Как я и предполагал, ваши json данные всегда такие.
[ { "status": 200, "values": [ { "total_transaction": 7, "total_deposit": 4, "total_withdrawal": 3, "total_request": 4, "accepted_request": 1, "pending_request": 0 } ] } ]
вы должны изменить свой код на ответ ios. Код может решить вашу проблему.
import axios from 'axios';
import dashboardData from '@/services/dashboard.service'
var dataValue = []
export default {
name: 'DashboardInfo',
data () {
return {
infoTiles: [{
color: 'success',
value: 0,
text: 'Total Transaction',
icon: '',
}, {
color: 'danger',
value: 0,
text: 'Total Deposit',
icon: '',
}, {
color: 'info',
value: 0,
text: 'Total Withdrawal',
icon: '',
}, {
color: 'info',
value: 0,
text: 'Total Request',
icon: '',
}, {
color: 'info',
value: 0,
text: 'Accepted Request',
icon: '',
}, {
color: 'info',
value: 0,
text: 'Pending Request',
icon: '',
}],
}
},
created(){
var that = this;
axios
.get('/dashboard')
.then(response => (response.data))
.then(result => {
var values = result.data.values;
var infoTiles = that.infoTiles;
infoTiles[0].value = values['total_transaction'] ? values['total_transaction'] : 0;
infoTiles[1].value = values['total_deposit'] ? values['total_deposit'] : 0;
infoTiles[2].value = values['total_withdrawal'] ? values['total_withdrawal'] : 0;
infoTiles[3].value = values['total_request'] ? values['total_request'] : 0;
infoTiles[4].value = values['accepted_request'] ? values['accepted_request'] : 0;
infoTiles[5].value = values['pending_request'] ? values['pending_request'] : 0;
that.$set(that, 'infoTiles', infoTiles);
})
}
}