SHARE
TWEET

Untitled

a guest May 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { LightningElement, wire, track } from 'lwc';
  2. import { NavigationMixin} from 'lightning/navigation';
  3.  
  4. export default class NavigationLinkExample extends NavigationMixin(LightningElement) {
  5.     @track url;
  6.  
  7.     connectedCallback() {
  8.         this.accountHomePageRef = {
  9.             type: "standard__objectPage",
  10.             attributes: {
  11.                 "objectApiName": "Account",
  12.                 "actionName": "home"
  13.             }
  14.         };
  15.         this[NavigationMixin.GenerateUrl](this.accountHomePageRef)
  16.             .then(url => this.url = url);
  17.     }
  18.  
  19.     handleClick(evt) {
  20.         evt.preventefault();
  21.         evt.stopPropogation();
  22.         this[NavigationMixin.Navigate](this.accountHomePageRef);
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top