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

190
Vistas
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 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