lightning/navigation
.We need to flow below steps for impplemention :-
- we need to import the lightning/navigation module.
import { NavigationMixin } from 'lightning/navigation';
- Apply the NavigationMixin function to your component’s base class.
export default class MyCustomElement extends NavigationMixin(LightningElement) {}
- Create a plain JavaScript PageReference object that defines the page
To dispatch the navigation request, call the navigation service’s [NavigationMixin.Navigate] (pageReference, [replace])
navigateNext() {
this[NavigationMixin.Navigate]({
type: 'standard__navItemPage',
attributes: {
apiName: this.tabName,
},
});
}
The NavigationMixin adds two APIs to your component’s class.
Since these APIs are methods on the class, they must be invoked with this reference.