Skip to content

Instantly share code, notes, and snippets.

@artokun
Created February 7, 2018 06:36
Show Gist options
  • Save artokun/6a4eee56604304b19b211f35817115b0 to your computer and use it in GitHub Desktop.
Save artokun/6a4eee56604304b19b211f35817115b0 to your computer and use it in GitHub Desktop.
<template>
<div>
<h1>System List</h1>
<ul>
<li :key="item.key" v-for="item in testCollection">{{item}}</li>
</ul>
</div>
</template>
<script>
export default {
data() {
return {
testCollection: [],
};
},
mounted() {
const db = this.$firebase.firestore();
db
.collection('test')
.get()
.then(snap => {
const testCollection = [];
snap.forEach(doc => {
testCollection.push({ [doc.id]: doc.data() });
});
this.testCollection = testCollection;
});
},
};
</script>
<style lang="scss">
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment