Sample using nuxt and vuexfire.
-
Set the databaseURL of firebase
import firebase from 'firebase' if (!firebase.apps.length) { firebase.initializeApp({ // Set up your domain databaseURL: 'https://xxx.firebaseio.com/', }) } export default firebase
-
Set the db.ref
import firebase from '@/plugins/firebase' import { firebaseMutations, firebaseAction } from 'vuexfire' const db = firebase.database() // Set up your db.ref const itemsRef = db.ref('xxx')
-
Set the property
// Set the property <div v-for="item in items" :key="item.id"> <li>{{ item.id }}</li> </div>
# install dependencies
$ npm install # Or yarn install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm start
# generate static project
$ npm run generate
For detailed explanation on how things work, checkout the Nuxt.js docs.