發表文章

目前顯示的是 2月 15, 2019的文章

Firebase beforeeach() fires a lot of times (Vue app)

圖片
0 I am building posts app using Firebase and Vue js. I have some issue: My router: import Vue from 'vue' import Router from 'vue-router' import Dashboard from '@/components/Dashboard' import Login from '@/components/Login' import SignUp from '@/components/SingUp' import RecentPosts from '@/components/RecentPosts'; import firebase from 'firebase' Vue.use(Router) let router = new Router( routes: [ ...... some routes path: '/recentPosts', name: 'RecentPosts', component: RecentPosts, meta: requireAuth: true ] ) router.beforeEach((to, from, next) => let currentUser = firebase.auth().currentUser; let requiresAuth = to.matched.some(r => r.meta.requiresAuth); console.log("CURRENTUSER",currentUser); if(!currentUser && requiresAuth) next('Login'); else if(currentUser && !requiresAuth) next('Dashboard'); else if (currentUser && requiresAu

Battle of Cold Harbor

圖片
Battle of Cold Harbor Part of the American Civil War Battle of Cold Harbor by Kurz and Allison, 1888 Date May 31  ( 1864-05-31 ) – June 12, 1864  ( 1864-06-13 ) Location Hanover County, near Mechanicsville, Virginia 37°35′24″N 77°17′06″W  /  37.59°N 77.285°W  / 37.59; -77.285 Coordinates: 37°35′24″N 77°17′06″W  /  37.59°N 77.285°W  / 37.59; -77.285 Result Confederate victory [1] Belligerents United States (Union) CSA (Confederacy) Commanders and leaders Ulysses S. Grant George G. Meade Robert E. Lee Units involved Army of the Potomac [2] XVIII Corps [3] (Army of the James) Army of Northern Virginia Strength 108–117,000 [4] 59–62,000 [4] Casualties and losses 12,738 total 1,845 killed 9,077 wounded 1,816 captured/missing [5] [6] 5,287 total 788 killed 3,376 wounded 1,123 captured/missing [6] v t e Overland Campaign Wilderness Spotsylvania Court House Yellow Tavern Meadow Bridge North Anna Wilson's Wharf Haw's Shop Totopotomoy Creek Old Church Cold Harbor Trevilia