0

I am using NavigationMixin. But it will help to open record/list. I want similar link to open another LWC.

this[NavigationMixin.Navigate]({
                type: 'standard__objectPage',
                attributes: {
                    objectApiName: 'Account',
                    actionName: 'list'
                },
                state: {
                    filterName: 'Recent'
                },
            });
1

There is option to add link to standard__component. It only supports aura. So for now you need to embed your LWC component into aura component with lightning:isUrlAddressable interface implemented. Something like that:

<!-- c:MyLightningComponent -->
<aura:component implements="lightning:isUrlAddressable">
  <aura:attribute name="counter" type="Integer"/>

  <c:lwcComponent/>
</aura:component>

So your navigation will be like

this[NavigationMixin.Navigate]({
    type: 'standard__component',
    attributes: {
        componentName: 'c__MyLightningComponent'
    },
    state: {
        c__counter: '5'
    }
});
  • It worked. Thanks a lot @ytiq – user9050403 Sep 13 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.