Hi good day how can we use kt-datatable component with axios in vuejs ? When we tried this its not updating the table data
setup() {
const tableHeader = ref([
{
key: "checkbox",
sortable: false,
},
{
name: "Name",
key: "Name",
sortable: true,
},
]);
let tableData = ref([]);
onMounted(async () => {
const { data } = await axios.get(API_URL_HERE, {
headers: {
'Authorization': this.token
}
tableData = data
})
});
return {
tableData,
tableHeader
};
},
Hi @Lauris thanks for your response but that doesnt seem to work
I am sorry, in your case there should be just a data instead of data.value.
tableData.value.splice(0, tableData.value.length, ... data);
Can you try the code example below?
tableData.value.splice(0, tableData.value.length, ... data.value);
tableData = data