Hi Laurent! If I understand you correctly, I’d say you have a couple of solutions:

  1. 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…
  2. 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! 👋

Words matter — Frontend development, CSS, UX, design, lean, agile and everything in between. https://afontcu.dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store