Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!