[Vuejs]-Blank Data by Fetching data from DB using Laravel 9 and Vue.js 3 and Axios

0👍

Found a solution to my problem. For some reason if i use «this» directly Axios doesn’t work, so i had to create a variable, and it worked

methods: {
            getProdutos(){
                var vm = this
                axios.get('/get_produtos')
                     .then((response)=>{
                       vm.produtos = response.data
                     })
            }
        },
        created() {
            this.getProdutos()
        }

Leave a comment