[Vuejs]-Nuxt – result.forEach is not a function?

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
}

Leave a comment