0👍
First get and modify Your data, then return it.
Modify Your code so it looks like this:
async asyncData () {
let data = []
await firebase.firestore()
.collection('test')
.doc()
.get()
.then((result) => {
result.forEach(doc => {
data.push(doc.data())
})
})
return data
}
- [Vuejs]-Vue // How to point to assets folder from js method?
- [Vuejs]-Nuxt JavaScript hooks transition – a bug?
Source:stackexchange.com