I am import a firebase at the top of my /buildings.vue component:
...
import buildingsadd, { buildingsRef } from './buildingsadd.vue';
export default {
firebase() {
return {
buildings: buildingsRef
}
},
components: {
buildingsadd
},
name: 'buildings',
...
On the the /buildingsadd.vue component I am defining a new path to the the firebase ref like this:
...
import firebase from '../firebase-config';
import { db } from '../firebase-config';
export default {
firebase() {
return {
buildings: buildingsRef,
users: usersRef,
}
},
name: 'buildingsadd',
data () {
return {
newBuilding: {
name: '',
}
}
},
methods: {
addBuilding: function () {
let userId = firebase.auth().currentUser.uid;
let buildingsRef = db.ref('buildings/'+userId);
}
...
But I am getting this errors:
Answers to this would also solve my particular problem: