Create Chat Rooms Create a chat room in Firestore linked to the current user

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.
Get Unlimited PRO Access


*Enrollment provides full access to this course (and updates) for life.

Chat List Component

    <button @click="createChatRoom()" class="button">Create New Chat Room</button>

import { db } from '../firebase';

export default {
  data() {
    return { 
        chats: [] 
  firestore() {
    return { 
        chats: db.collection('chats').where('owner', '==', this.uid) 
  methods: {
      async createChatRoom() {
          const newChat = await db.collection('chats').add({
              owner: this.uid,
              members: [this.uid]


  props: ['uid']


Q&A Chat