I have my firebase DB with this tree structure.
I use vue-fire to loop through the database. I want to retrieve the "CantFindMe" value in the name property. My files look like this:
// Dashboard.vue
<template>
<div class="">
<ul>
<li v-for="personName in names" v-bind:key="personName['.key']">
<div v-if="!personName.edit">
<p>{{ personName.forms.step1 }}</p>
</div>
</li>
</ul>
</div>
</template>
<script>
import { namesRef} from '../firebase.js'
export default {
name: 'app',
data () {
return {
name: ''
}
},
firebase: {
names: namesRef
}
}
</script>
// Firebase.js
{ The usual firebase config }
{...}
export const firebaseApp = firebase.initializeApp(config)
export const db = firebaseApp.database()
export const namesRef = db.ref('names')
I manage to read the object: { "-KxrySGBHgLvw_lPPdRA": { "edit": false, "name": "CantFindMe" } }
But when I try to add ".name" after ".step1", that should supposedly return "CantFindMe", I get nothing/blank back.
How do I get to the name property using VueJs to return "CantFindMe"?