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

193
Visualizações
I'm trying to display another lwc that is table within this tab from the JS file

I know that I can replace {layer.content} with <c-skills></c-skills> tag and that it displays fine within the HTML file but is there a way for me to call it from the JS file and put it in the tab Content declaration? I know that putting it in quotes doesn't work and just pasting the tag in it as well won't work. My main goal is to add the '' from the js. HTML:

<template >
        <!--Template for the content area-->
         <template for:each={tabs} for:item="layer">
             <div id={layer.ariaControls} class={layer.cssClass}  data-id={layer.Id} role="tabpanel" aria-labelledby={layer.Id}
                 key={layer.Id}>
                 {layer.Content}
             </div>
            </template>  
    </div>

</template>

JS:


import { LightningElement } from 'lwc';
    export default class masteriesAndFeats extends LightningElement {
        tabs = [{
            title: "Masteries",
            Content: "content1",
            Id: "tab-scoped-1__item",
            cssTab:"slds-tabs_scoped__item slds-is-active slds-size_1-of-2 tabStyle",
            cssClass: "slds-tabs_scoped__content slds-show",
            index: "0",
            ariaControls:"tab-scoped-1",
            selected: "true",
            
        }, {
            title: "Feats",
            Content: "Content2",
            Id: "tab-scoped-2__item",
            cssTab:"slds-tabs_scoped__item slds-size_1-of-2 tabStyle",
            cssClass: "slds-tabs_scoped__content slds-hide",
            index: "-1",
            ariaControls:"tab-scoped-2",
            selected: "false",
            
        }];
        handleClick(event) {
            this.tabs = this.tabs.map(tab => {
                if(tab.Id === event.target.dataset.link) {
                    tab.cssClass = "slds-tabs_scoped__content slds-show";
                    tab.index = "0";
                    tab.selected = "true";
                    tab.cssTab = "slds-tabs_scoped__item slds-size_1-of-2 slds-is-active tabStyle";
                } else {
                    tab.cssClass = "slds-tabs_scoped__content slds-hide";
                    tab.index = "-1";
                    tab.selected = "false";
                    tab.cssTab = "slds-tabs_scoped__item slds-size_1-of-2 tabStyle";
                }
                return tab;
              });
            }
    }
about 4 years ago · Juan Pablo Isaza
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