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

173
Vistas
Is there any way to pass a DOM element as a prop in Vue 3?

I'm super new to Vue. While I don't normally do this, I think something like this would be possible in React + JSX (untested):

render() {
  const el = <p>Blah <a href="https://example.com">bloop</a> bleh</p>
  return (
    <div>
      <CustomReactComponent someProp={el}
    </div>
  )
}

Where CustomReactComponent would be able to render the element out of this.props.someProp.

Can I achieve this in Vue?


For the curious, my use case is similar to my very untested React example above. I would like some, but not all parent components of a common tiny component to pass in some text to display somewhere. Except I'd like to include links wherever I please, so I need <a> tags in there. I figured I could make that work by passing a whole <p> or <span> element as a prop.

Alternate solutions welcome!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As Estus said in their comment, this is what the slots feature is for.

about 4 years ago · Juan Pablo Isaza 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