これで取得出来ます。
firebaseから取得するメソッドを作って、created()で呼び出せば大丈夫です。
あと質問はそのままにしない方が良いかと思います。
過去の質問
同じ様な質問ですよね。
vue
1<template>
2 <div>
3 <h1>test page</h1>
4 <div v-for="(data, key) in notes" :key="key">key:{{ key }} ⇒ value:{{ data }}</div>
5 </div>
6</template>
7
8<script>
9import { database } from "@/services/fireinit.js"
10// import { mapState } from "vuex"
11
12export default {
13 props: ["user"],
14 data() {
15 return {
16 note_content: "hello",
17 notes: []
18 }
19 },
20 created() {
21 this.fetchData()
22 },
23 computed: {
24 ...mapState({
25 // mypageUrl: state => `/user/${state.uid}`
26 })
27 },
28 methods: {
29 saveContent(value) {
30 // const newNoteKey = database
31 // .ref()
32 // .child("note-test")
33 // .push().key
34 // const today = Date.now()
35 // database.ref(`notes/${this.user.uid}/${newNoteKey}`).set({ content: value, date: today })
36 },
37 async fetchData() {
38 await database.ref("note-test/abcdefgh").once("value", snapshop => {
39 this.notes = snapshop.val() || []
40 })
41 }
42 }
43}
44</script>
45
js
1# fireinit.js
2
3import * as firebase from "firebase/app"
4import "firebase/database"
5import "firebase/storage"
6
7const config = {
8 apiKey: <your key>,
9 authDomain: <your key>,
10 databaseURL: <your key>,
11 projectId: <your key>,
12 storageBucket: <your key>,
13 messagingSenderId: <your key>
14}
15
16!firebase.apps.length ? firebase.initializeApp(config) : ""
17export const database = firebase.database()
18export const storage = firebase.storage()
19export default firebase
json
1# firebase
2
3{
4 "note-test" : {
5 "abcdefgh" : {
6 "100" : "あ",
7 "101" : "い",
8 "103" : "う"
9 }
10 }
11}