[Vuejs]-Vue share external library with all (or most) components

2👍

You can use instance properties: https://v2.vuejs.org/v2/cookbook/adding-instance-properties.html

// In your main js file
Vue.prototype.$firebase = Firebase.initializeApp({
  apiKey: "123456789",
  projectId: "projectid-1234",
})

new Vue({
   //...
})

// In your child component
//...
this.$firebase.database().ref('users')
//...

Leave a comment