vuefire

How to use Moment.js with Vuexfire

拈花ヽ惹草 提交于 2020-01-27 08:47:24
问题 I am building a Vue.js application that uses Vuexfire in a store.js file. My application enables a user to push user-inputted posts with timestamps into Firestore. I am configuring my Vuexfire action handler to commit to mutation the firebase payload arranged in order by timestamp, like so: import Vue from "vue"; import Vuex from "vuex"; import firebase from "firebase"; import { vuexfireMutations, firestoreAction } from 'vuexfire' import { db } from "@/main"; import moment from 'moment' Vue

Vue set Firebase data using Key

孤者浪人 提交于 2020-01-15 10:21:51
问题 I'm having trouble with a Vue Method that both pushes a new deal to one Firebase ref and sets data in another. The issues lies when the method sets data. My current method is unable to get the key of deal that it is writing to the dealsRef in order to save it in the dealsRel. Firebase Refs: // Firebase reference to deals const dealsRef = db.ref('deals'); // Firebase reference to deal "relations" const dealsRel = db.ref('dealsRel'); Method: addDeal() { // Push new Deal to Firebase dealsRef

How to get the user info to the “data” part of the app in vue.js?

女生的网名这么多〃 提交于 2019-12-30 13:02:15
问题 Would you happen to know how to set the user to the currentUser? I am using vuefire and firebase. The user.uid is returning undefined. <td v-if="(building['key'] && building['key'].child('ownerId')) == user.uid"> <p >{{building['.key']}} + {{user.uid}}</p> </td> this is the rest of my code: import firebase,{ db, usersRef, buildingsRef } from '../firebase-config'; import { store } from '../store/store'; export default { firebase() { // from my understanding this just gives me a quick access to

How to get the user info to the “data” part of the app in vue.js?

浪子不回头ぞ 提交于 2019-12-30 13:01:25
问题 Would you happen to know how to set the user to the currentUser? I am using vuefire and firebase. The user.uid is returning undefined. <td v-if="(building['key'] && building['key'].child('ownerId')) == user.uid"> <p >{{building['.key']}} + {{user.uid}}</p> </td> this is the rest of my code: import firebase,{ db, usersRef, buildingsRef } from '../firebase-config'; import { store } from '../store/store'; export default { firebase() { // from my understanding this just gives me a quick access to

Is it possible to bring the “user” object to the “top level” and access it from outside the “on.AuthSateChanged(user => … }”? [duplicate]

房东的猫 提交于 2019-12-25 00:44:33
问题 This question already has answers here : Retrieve String out of addValueEventListener Firebase (3 answers) Closed last year . I am trying to define a ref in vuefire to firebase path that depends on the current User. Is it possible to bring the "user" object to the "top level" and access it from outside the "on.AuthSateChanged(user => .... }" ? firebase-config.js import * as firebase from "firebase"; var config = { apiKey: "XXXXXX", authDomain: "XXXXXX.firebaseapp.com", databaseURL: "https:/

How to connect Firebase to FullCalendar Vue Component

对着背影说爱祢 提交于 2019-12-18 09:37:19
问题 I am attempting to add Firebase backend to a FullCalendar Vue Component, based on the following: (https://github.com/fullcalendar/fullcalendar-example-projects/tree/master/vue). So far, I have been successful in setting up handleDateClick() method to push calendar events into Firestore. I am attempting to use a Vuefire firestore option to return stored calendar events to the calendarEvents data object. The events should then be rendered on the calendar. However, I am not seeing any stored

How to create dynamic references in VueFire?

时光毁灭记忆、已成空白 提交于 2019-12-11 07:14:46
问题 I'm trying to create refs dynamically: My first ref works because it's hardcoded but the second doesn't, apparently because it's dynamic: firebase: function(){ return { categories: db.ref('categories'), subcategories: db.ref('categories').child(this.addItem.category) } } Does anyone know how to get around this? 回答1: I created a dynamic db ref by using vm.$bindAsObject found in the vue-fire docs. I used it in the created hook with a project id, like so: created () { this.$bindAsObject('project

Vue.js 2 with Firebase Crud example

二次信任 提交于 2019-12-11 05:22:09
问题 I'm struggling to edit a single item with vue and firebase. My edit page url receives item's id. So what I want is to load this single item from firebase. Edit it and save it back into firebase. I use vue version 2 and vuefire. I'm stuck at loading a single item from firebase and displaying it in a form. Here is what I've got so far: <template> <div> <h1>Item: {{ item.name }}</h1> <label>Name</label> <input type="text" value="" name="hive-name"/> </div> </template> <script> import { db } from