LoginSignup
2
2

More than 3 years have passed since last update.

Vuex@3.0.0-alpha6以上あたりで、firebaseMutationsがないだの collection.on is not a functionだのでて動かない

Last updated at Posted at 2019-07-05

原因

バージョンアップで使い方が変わった(この記事を書いている時点でvuexfire 3.0.0-alpha.18)

vuexfire:firebaseMutationsの名前をvuexfireMutationsに変更しました。 RTDBの使用も許可したいのでfirebaseActionをfirestoreActionに変更し、その名前をfirebaseActionにも使用します。
原文: vuexfire: Rename firebaseMutations into vuexfireMutations. Rename firebaseAction into firestoreAction since we want to allow using RTDB as well and that name will be used for the firebaseAction as well
引用

しかも https://github.com/posva/vuexfire は途中から https://github.com/vuejs/vuefire/tree/master/packages/vuexfire に写ったため、古い方のREADMEを参考にして使おうとすると駄目。ちゃんと新しい方のREADMEを参考にしよう。

対処法

Firestoreを使っているとして、importするモジュールを下記に変更

- import { firebaseAction, firebaseMutations } from 'vuexfire'
+ import { firestoreAction, vuexfireMutations } from 'vuexfire'

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2