Created
February 7, 2018 06:36
-
-
Save artokun/6a4eee56604304b19b211f35817115b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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