posva / vuexfire

Check
https://github.com/vuejs/vuefire
MIT License
558 stars 49 forks source link

Configuration problem #205

Closed FlorianChretien closed 5 years ago

FlorianChretien commented 5 years ago

Hello,

Sorry to bother you but I am stuck for many days without moving forward ... Can not make the example work ...

Do you have a track? See the solution? I searched everything but I can not find ... Really sorry for this idiot question :/

thanks

store

screenshot at nov 25 21-05-58

component

screenshot at nov 25 21-05-48

(VueCli with VueRouter, Vuex, Webpack ...)

posva commented 5 years ago

if you put the data from the store in data, it will take the initial value (empty array). Use a computed property instead:

computed: {
  todos () {
    return this.$store.todos
  }
}

(you should check vuex docs 😛 )

FlorianChretien commented 5 years ago

I tried otherwise and it still does not work ....: '( Thank you for your help!

(Yet it works with viewfire)

store

screenshot at nov 26 16-39-51

component

screenshot at nov 26 16-39-41

TypeError : "document.onSnapshot is not a function" screenshot at nov 26 16-51-49

aspben commented 5 years ago

Something tell me that it's à problem with the firebase ref syntax. Did you try firebase. Database().Ref('utilisateurs')

Also what db do you use just to be sure and are you using the corresponding version of vuexfire?

FlorianChretien commented 5 years ago

Hi! Thank you for your response @aspben. I use the following list :

screenshot at nov 26 17-09-09

If I try to replace .ref with .collection I will make an error .. :/ "_services_firebase_firebase__WEBPACK_IMPORTED_MODULE_6__.db.collection is not a function"

It's a base for me that works if I use vuefire. My config :

screenshot at nov 26 17-12-29
aspben commented 5 years ago

I just checked. On my project the version is alpha-9 and I use firestore. Im not sure vuexfire work for both database. Maybe check into that.

posva commented 5 years ago

vuefire < 2 is for the RTDB, vuexfire > 3 and vuefire > 2 are for Firestore. In the future, newer versions will support both versions but right now it doesn't

FlorianChretien commented 5 years ago

Yes my bad ! 😄 Thanks toi very much @aspben @posva