Skip to content

Commit

Permalink
作成日時順にソートしよう
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yoshiii committed Jul 26, 2022
1 parent 321b5c2 commit 0c9d823
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/views/ChatBoard.vue
Expand Up @@ -66,7 +66,10 @@ export default {
}
this.room = roomDoc.data();
console.log("room", this.room);
const snapshot = await roomRef.collection("messages").get();
const snapshot = await roomRef
.collection("messages")
.orderBy("createdAt", "asc")
.get();
snapshot.forEach((doc) => {
this.messages.push(doc.data());
});
Expand Down

0 comments on commit 0c9d823

Please sign in to comment.