I am stuck at this point while working on VueJs as i want to log the data from firebase . I changed the code according to the suggestions on the console but nothing is working . I am using Vue Cli 3 and firebase 5.5.9 .
<script>
import db from './firebaseInit'
export default {
name: 'dashboard',
data(){
return{
employees: []
}
},
created(){
db.collection('employees').get().then
(querySnapshot => {
querySnapshot.forEach(doc => {
console.log(doc.data())
const data = {
}
})
})
}
}
</script>
This is my firebaseInit.js
import firebase from 'firebase'
import 'firebase/firestore'
import firebaseConfig from './firebaseConfig'
const firebaseApp = firebase.initializeApp(firebaseConfig)
// const firestore = firebase.firestore();
// const settings = {timestampsInSnapshots: true};
// firestore.settings(settings);
export default firebaseApp.firestore()