0๐
โ
I did not see any issues with the axios
response you are getting. As v-data-table
need an array
to iterate and you are getting the same from the API response.
Working Demo :
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: () => ({
dataList: [{
"user_no": 1,
"user_nickname": "hailey"
},
{
"user_no": 2,
"user_nickname": "mandi"
},
{
"user_no": 3,
"user_nickname": "loren"
},
{
"user_no": 4,
"user_nickname": "james"
}]
}),
computed: {
gridHeaders() {
return [
{ text: "User Number", value: "user_no" },
{ text: "User Nickname", value: "user_nickname" }
];
},
},
})
<script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.5.0/dist/vuetify.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/vuetify/dist/vuetify.min.css" rel="stylesheet">
<div id="app">
<v-data-table :headers="gridHeaders" :items="dataList" item-key="user_no">
</v-data-table>
</div>
0๐
Source:stackexchange.com