1 min readOct 23, 2018
Hi Laurent! If I understand you correctly, I’d say you have a couple of solutions:
- The easiest one: you can simply pass all props all components might need. A component will ignore non requested props, so as long you don’t have name conflicts, you are good to go. but it feels ugly…
- As you said, you could create a computed object with the required props for each component. The cool part here is that you could use
v-bind
to avoid passing a single object as prop, but instead destructure it:
<component :is="componentName" v-bind="componentProps" />
Hope it helps! 👋