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

236
Vistas
Is there a way to access slot in Svelte component created using Client-side component API?

I am creating a svelte component in use:action function and I need to get add dynamic content inside the component. Does svelte allow to replace slot during or after creation of a svelte component?

Example code

export default function (node: HTMLElement) {
  let component = new Component({
      props: {},
      target: node,
      // maybe this
      slot: anotherComponent,
  });

  // or this
  component.slot = anotherComponent;

  return {
    update() {},
    destroy() {
      component.$destroy();
    },
  };
}
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

That is currently not supported, though that is a popular feature request. As noted in the issue, you can use private APIs at the peril of them breaking at any point.

You might be able to work around this by exposing an element of the component and mounting the child component there.

about 4 years ago · Santiago Gelvez 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