Skip to content

Commit

Permalink
firestore databaseにデータを登録しよう
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yoshiii committed Jul 22, 2022
1 parent 867ab83 commit d378d1d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/router/index.js
@@ -1,7 +1,7 @@
import Vue from "vue";
import VueRouter from "vue-router";
// import HomeView from "../views/HomeView.vue";
import UserList from "../views/UserList.vue";
import RoomListView from "../views/roomListView";
import ChatBoard from "../views/ChatBoard.vue";
import LoginView from "../views/LoginView.vue";
import SignupView from "../views/SignupView.vue";
Expand All @@ -13,7 +13,7 @@ const routes = [
{
path: "/",
name: "home",
component: UserList,
component: RoomListView,
meta: { requiresAuth: true },
},
{
Expand Down Expand Up @@ -60,16 +60,6 @@ router.beforeEach((to, from, next) => {
} else {
next();
}
// firebase.auth().onAuthStateChanged((user) => {
// if (!user) {
// next({
// path: "/login",
// query: { redirect: to.fullPath },
// });
// } else {
// next();
// }
// });
} else {
next();
}
Expand Down
33 changes: 33 additions & 0 deletions src/views/roomListView.vue
@@ -0,0 +1,33 @@
<template>
<v-app id="inspire">
<SideBar />
<v-app-bar app shrink-on-scroll>
<v-toolbar-title>ルーム一覧</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon>
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
</v-app-bar>

<v-main>
<v-container>
<v-row>
<v-col v-for="n in 24" :key="n" cols="4">
<router-link :to="{ path: 'chat', query: { user_id: n } }">
<v-avatar color="grey lighten-2" size="128"></v-avatar>
</router-link>
</v-col>
</v-row>
</v-container>
</v-main>
</v-app>
</template>

<script>
import SideBar from "@/components/layouts/SideBar";
export default {
components: {
SideBar,
},
};
</script>

0 comments on commit d378d1d

Please sign in to comment.