apexchart field in Laravel Vue3 metronic 8 demo 1
Hi !
I'm trying to implement a
apexchart I wrote this code to get data:
onBeforeMount(async () => {
const cats = await GetRemovalReasons().then(({data}) => data).catch(e => []);
categories.value.splice(0, categories.value.length, ...cats);
Object.assign(chart.value, chartOptions(categories.value));
}); But it doesn't work. When I'm deleting the await... part and assigning similar static data then it works.
Can you help me figure it out?
Thanks in advance,
Vahan
Replies (2)
Hi Vahan,
Your issue seems to be that you're using both await and .then() together. You should choose either async/await or .then() to handle the result of the promise.
Regards,
Lauris Stepanovs,
Keenthemes Support Team