Globally-available mixin in VueJS

I would suggest setting your mixin up as a plugin. To do that, wrap it within an function call install and export the install function. Then, wherever your instantiate your app, you can simply do Vue.use(yourMixin):

Docs:

https://vuejs.org/guide/plugins.html

http://vuejs.org/api/#Vue-mixin

Example:

//- build your mixin
const mixin = {
  // do something
}

//- export it as a plugin
export default {
  install (Vue, options) {
    Vue.mixin(mixin)
  }
}

//- make it globally available
import myMixin from './myMixin'
Vue.use(myMixin)

Vue.use calls in the install fn(), so all subsequent Vues (or all if none have yet been created) have the mixin functionality

Careful of namespace clashes on globally available mixins (!)