I'm trying to call a function from methods in mounted() but it returns undefined. If I make a console.log it shows the result. What I'm doing wrong?
methods: {
bsBooks: () => {
axios
.get(
"https://api.nytimes.com/svc/books/v3/lists/best-sellers/history.json?api-key=mykey_is_here"
)
.then(res => {
return res.data.results
});
}
},
mounted() {
console.log(bsBooks())
}