Skip to content

mirkoferraro/vue-mixins-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vue Mixins Store

Vue plugin that store mixins

Why

The Vue.mixin() function register a globally mixin that isn't the best for performance. This plugin provides a way to register mixins, keep them in a defined store and use them when needed.

Installation

$ npm install vue-mixins-store

Usage

Load the store

import Vue from 'vue'
import VueMixinsStore from 'vue-mixins-store'
Vue.use(VueMixinsStore)

Register a mixin

Vue.mixin({ ... }) // old way, register a global mixin
Vue.mixin('myMixin', { ... }) // new way, register a stored mixin

Use a registered mixin

import Vue from 'vue'
export default {
    mixins: [
        Vue.$mixins.myMixin
    ]
}

About

Vue plugin that store mixins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published