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
Hello Geetha A 2Please find the solution.First you have to store the image in static resourse:-
staticResourceLWCExample.html
<template> <lightning-card title="Static Resource Example LWC" icon-name="custom:custom19"> <div class="slds-m-around_medium"> <img src={yin} download> </div> <div> <a href={url} onclick={handleClick} download="">Download</a> </div> </lightning-card> </template>
import { LightningElement } from 'lwc'; import My_Resource from '@salesforce/resourceUrl/yin'; import { NavigationMixin } from 'lightning/navigation'; export default class StaticResourceLWCExample extends NavigationMixin(LightningElement) { yin = My_Resource; url; handleClick(evt) { this.url="https://power-agility-6120-dev-ed.lightning.force.com/resource/1638705339000/yin"; } }
<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>48.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AppPage</target> <target>lightning__RecordPage</target> <target>lightning__HomePage</target> </targets> </LightningComponentBundle>
Hello Geetha A 2
Please find the solution.
First you have to store the image in static resourse:-
staticResourceLWCExample.html
staticResourceLWCExample.js Enter the url of image (open image in new tab
staticResourceLWCExample.js-meta.xml
Please mark it as the best answer so that other people can take reference from it.
Thank You
My requirement is to prepare dynamic image (png) based on contact information which is available on LWC html.Let me know if you need more information on this