I have this code in html:
<lightning-progress-indicator id="path" current-step={currentStep} type="path" variant="base">
<template for:each={allStages.data} for:item="stage">
<lightning-progress-step label={stage.Name} value={stage.Name} key={stage.Name} onclick={handleClick} ></lightning-progress-step>
</template>
</lightning-progress-indicator>
</template>
Code in js:
import getAllStages from '@salesforce/apex/PathController.getAllStages';
import STAGE_NAME from '@salesforce/schema/Stage__c.Name';
export default class CustomPath extends LightningElement {
@api recordId;
@track currentStep
@wire(getAllStages, { matterId: '$recordId', fields: [STAGE_NAME] })
allStages;
handleClick(event){
this.currentStep = event.target.index;
window.console.debug(this.currentStep);
}
So, how can I fill current-step={currentStep}
from js?