Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda