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

131
Vistas
what can't be passed by vue slot props?

In official react docs, It says the difference between 'other libraries's slot' and 'react's props.children' is as follows :

This approach may remind you of “slots” in other libraries but there are no limitations on what you can pass as props in React.
https://reactjs.org/docs/composition-vs-inheritance.html

And it sounds like there are some things can't pass through a 'vue slot'. Is there any thing can't be passed by vue slot's props?

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

0

In vue you have props as well. The difference and what may have been confusing you is that:

  • (vue) props === (react) props
  • (vue) slots === (react) props.children

You can pass data through props in both frameworks/libraries, but what you place inside <YourComponent>[content]</YourComponent will in vue terms be a slot and in react terms be accessible through props.children.

Let's say we have a popup/modal component which sole purpose is to act as a frame for the actual popup/modal content:

// parent component
<Modal>
    <p>Watch out! Do you want to continue</p>
    <button>Yes</button>
    <button>No</button>
</Modal>

Then you would have the modalcomponent itself

// react
<div>
    // this will output whatever you put inside the
    // <Modal> tags in you parent component
    {props.childen}
</div>

// vue
<div>
    // the <slot> tag works the same way
    // as React's {props.children}
    <slot></slot>
</div>

Read more about vue slots here and vue props here.

When you're more familiar with the concepts you can read about vue's named slots here

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