JS
import { LightningElement } from 'lwc';
import Salesforce_Images from '@salesforce/resourceUrl/trailhead_logo';
export default class ImageDisplay extends LightningElement {
salesforceImageUrl = Salesforce_Images;
}
HTML
<template>
<lightning-card title="Use Static Resource in Lightning Web Component">
<div class="slds-p-horizontal_small">
<img src={salesforceImageUrl}>
</div>
</lightning-card>
</template>
I have stored image in static resource with name trailhead logo. but image is not appearing.
I have stored image in a zip file, then uploaded to static resource but not succeded.