is it better to keep all props in one large mix?

If your component library is not constrained to using Vue 2 you might want to take a look at Vue Composition API to share functionality (methods + reactive state) between different components.

Mixins might not be what you really want to be using because you kind of lose information as to what features/props/methods really will be put inside your component without re-checking the mixin code. You also might run into issues when component options get merged by Vue at runtime. Check out these posts for more information:

As for sharing props: What I’ve seen just yesterday (but not yet tried!) in a talk by John Leider – creator of Vuetify – is create a function that returns the props you want to reuse between components. Then you just call said function inside your props definition and use the spread operator.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top