Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

87
Vistas
passing a parameter to a dynamic component

I have a select inside the component. Depending on the value of the select, another component is rendered in the component.

How to pass props to a dynamic component if I render the component like this:

<component :is="valueSelect"></component>

or how to render a dynamic component with parameter passing

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can pass props to the dynamic component by v-bind with an object with each prop key and value

Ex:

<component :is="valueSelect" v-bind="componentProps"></component>


data: function () {
return {
    valueSelect: 'firstComponent',
  }
},
computed: {
  componentProps: function() {
    if (this.valueSelect === 'firstComponent') {
      return { firstProp: 'one' }
    } else if (this.valueSelect === 'secondComponent') {
      return { secondProp: 'two' }
    }
  }
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda