[Vuejs]-Cannot read property 'push' of undefined – vue and axios

0👍

I am not 100% sure if this is the answer, but I have found a workaround.

I was importing javascript files such as ‘dashboard_axios.js’ which did not get loaded in as I wished it would. So instead, I renamed the file to ‘dashboard_axios.vue’ and added <template></template>, and left it empty, and then wrapped my js code in <script></script> then on the dashboard.vue I called the <dashboard_axios /> tag and it worked as I expected.

Leave a comment