when I am developing, I will directly
export let getSliders = ()=>{
return axios.get("/sliders");
};
you can return the data to the component, but
export let getSliders = ()=>{
axios.get("/sliders").then(response=>{
console.log(response);//
}).catch((err)=>{
console.log(err);
})
};
this is how it is called in the component
async getSlider(){
this.sliders= await getSliders();
},
how can you not get it when you write it later with the then method? Or how to write the data returned by response? Ask for guidance