1.0.8 • Published 7 years ago
vue-firebase v1.0.8
Dependencies
- vue-router
- firebase
Install
Step 1
npm install vue-firebase --save
oryarn add vue-firebase
Step 2
add main.js
import * as firebase from "firebase";
import VueFirebase from 'vue-firebase'
// Config firebase project
const FBCONFIG = {
apiKey: "xxx",
authDomain: "xxx",
databaseURL: "xxx",
projectId: "xxx",
storageBucket: "xxx",
messagingSenderId: "xxx"
};
Vue.use(VueFirebase, {firebase: firebase, config: FBCONFIG});
Component Injections
this.$firebase
The firebase instance.
Easy check Auth routes
If you want to check the route, just add the meta and define the redirect
{
path: '/',
name: 'Hello',
component: HelloWorld
},
{
path: '/test',
name: 'Test',
component: test,
meta: { requiresAuth: false }
},
{
path: '/dashboard',
name: 'Dashboard',
component: dashboard,
meta: { requiresAuth: true, redirect: "/" }
}