LWC Stack is Lightning Web Component tutorial series by Salesforce MVP Kapil Batra. In this series you will find LWC tutorials from beginner to intermediate level.
So if you are working on it or planning to learn LWC then this video series is for you. Let's learn and grow together !
Please check complete code below from LWC Stack EP-28
HTML
1 2 3 4 5 6 7 | <template> <lightning-card title="Wire Current Page Reference" icon-name="utility:user"> <div class="slds-var-m-around_medium"> <div style="padding: 10px">{currentPageReference}</div> </div> </lightning-card> </template> |
1 2 3 4 5 6 7 8 9 10 | import { LightningElement, wire } from "lwc"; import { CurrentPageReference } from "lightning/navigation"; export default class WirePageReference extends LightningElement { @wire(CurrentPageReference) pageRef; get currentPageReference() { return this.pageRef ? JSON.stringify(this.pageRef) : ""; } } |
Checkout complete tutorial on YouTube
0 Comments