Skip to main content

Posts

Showing posts with the label load image in lightning

How to load image in LWC component ?

 1. First Load your image in Static Resource. Say name -  Financial_ComingSoon    2. Import @salesforce/resourceUrl here is the syntax  import   Financial_ComingSoon   from   '@salesforce/resourceUrl/Financial_ComingSoon' ; 3. Declare a variable in export function financeLogoUrl =  Financial_ComingSoon ; 4. Refer financeLogoUrl in component. StaticResourceImageLWCExample < template >      < lightning-card   title = "My Banking and Financial " >          < div   class = "slds-m-around_medium" >              < img   src = { financeLogoUrl } >                      </ div > </ template > Here is controller code import { LightningElement } from 'lwc' ...