Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Dylan0916/2fe00767dc457fcef934922723cd5640 to your computer and use it in GitHub Desktop.
Save Dylan0916/2fe00767dc457fcef934922723cd5640 to your computer and use it in GitHub Desktop.
<button onclick="getData()">get</button>
<script>
function getData() {
const docs = db.collection("to-do-list").doc("to-do");
docs
.get()
.then(doc => {
if (doc.exists) {
console.log(doc.data());
} else {
console.log("找不到文件");
}
})
.catch(error => {
console.log("提取文件時出錯:", error);
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment