I have problem in display the data which saved into an array of a firebase collection into a table in vueJS. when I use:
<tbody>
<tr v-for="{ id, symb } in getSymbols" :key="id">
<td>{{ symb }}</td>
</tr>
</tbody>
in the UI it shows me a blank table, but when I get a console log, the data is showing in console. Here is my firebase funcion
export const LoadSymbols = () => {
const symbols = ref([])
db.collection('alarms').onSnapshot(snapshot => {
symbols.value = snapshot.docs.map(doc => (doc.id))
console.log(symbols.value);
})
// onUnmounted(alarmDoc)
return symbols;
}
and here is my script section of vuejs file:
<script>
import {LoadSymbols} from "../firebase";
export default {
setup() {
const getSymbols = LoadSymbols()
return {getSymbols};
},
};
</script>
this is my UI which show nothing in td.