function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<aura:component> <img src="{!$Resource.MyImage}" alt="My Image" /> </aura:component>
Hi Sonali,
To display an image in an Aura component using a static resource, you can follow these steps:
1. Upload the image to a Static Resource:
- Go to Setup in your Salesforce org.
- In the Quick Find box, search for "Static Resources".
- Click on "Static Resources" under the "Develop" section.
- Click on the "New Static Resource" button.
- Enter a name for the static resource (e.g., "MyImage").
- Choose the image file from your local system by clicking on "Choose File" or dragging and dropping the file.
- Click "Save" to upload the image as a static resource.
2. Create an Aura component:- Create or open the Aura component file (e.g., MyComponent.cmp).
- Inside the component markup, add an `<img>` tag to display the image.
- Set the `src` attribute of the `<img>` tag to the URL of the static resource.
Here's an example of how the Aura component markup would look like:3. Save and deploy the Aura component:
Hope this will be Helpful.
Thanks!