I run into this problem, I've been trying to get Vue to retrieve at least the very basic setup from firebase. It doesn't. I've followed various routes and nothing worked, so maybe I'm missing out on something, maybe in plain sight.
I don't have any errors in the console and everything seems to work fine, apart from the fact that nothing is retrieved. Network connections don't seem to retrieve any response that may be associated with the db. Here is a screengrab from firebase, maybe I misunderstood firebase and the setup:
// Main.js
/* eslint-disable semi */
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import VueFire from 'vuefire';
Vue.use(VueFire);
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
//App.vue
<template>
<div id="app">
<p>This will render</p>
<div v-for="message in messages" :key="message.text"> <!-- This will NOT -->
<h4>{{ message.title }}</h4>
<p>{{ message.text }}</p>
<p>{{ message.timestamp }}</p>
</div>
</div>
</template>
<script>
import firebase from 'firebase';
var config = {
apiKey: "IN THE CODE I HAVE A WORKING API KEY",
authDomain: "vuemymessage.firebaseapp.com",
databaseURL: "https://vuemymessage.firebaseio.com",
projectId: "vuemymessage",
storageBucket: "vuemymessage.appspot.com",
messagingSenderId: "204332593971",
timestampsInSnapshots: true
};
let app = firebase.initializeApp(config);
let db = firebase.firestore();
export default {
name: "App",
data(){
return {
messages: []
}
},
firestore(){
return {
messages: db.collection('messages')
}
},
}
</script>
<style>
#app {
}
</style>