0👍
The Amazon API function getKeywordStats
is returning a Promise
– it’s an asynchronous operation. This means the function doesn’t return the result like a normal synchronous function, instead it returns a Promise
object which you can then register a callback function (via then
) to be called once the data is retrieved. Be sure to read up on how promises work; I won’t go into detail here since there’s lots of information about them already.
Move the API call into your component created
hook:
export default {
data() {
return {
terms: null
}
},
created() {
amazon.getKeywordStats('trump aftershock', 0, null, 'de').then(terms => {
this.terms = terms
})
}
}
- [Vuejs]-V-show on v-for creates unwanted return transition
- [Vuejs]-Trying to create an embed able Vue Component bundled with Laravel Mix
Source:stackexchange.com