I am using nuxt in mode with ssr: false. In nuxts's page /pages/users/index.vue I am trying fetch data inside nuxt's hook fetch like you can see below.
data () {
return {
users: [],
...
}
},
async fetch(ctx) {
const usersData = await ctx.$usersApi.getAll()
this.users = usersData
console.log('initialized users', this.users) // here is everything fine, users are filled
}
usersApi is just my wrapper for axios. As you can see, I also printed this.users if there are some data, but when I use users inside template, there are no data at all.
Can you tell me what I am doing wrong? Thank you.