Vue.use(VueFire,{project: {// ...},mixins: [functionspecialFirebaseAction({firebase},params){// What will you create ?console.log(params+' I see you')returnfirebase.auth().currentUser}]})// in components
computed: {user(){this.$firebase.specialFirebaseAction('params')}}
Supply vuex actions a second parameter that is firebase
// firebase namespaced moduleexportdefault{namespaced: true,/** * ...your state, getter, and mutations are here */actions: {// and now the magicsaveToFirebase({commit, rootState, state},{firebase, database},payload){// firebase.database() or justdatabase().ref('a/path/on/firebase').// you know the rest}}}
// just add 'root' to namespaces array to have your root action have a firebase parameter
vuex: {namespaces: ['root','firebase'],store: store}