Skip to content

Instantly share code, notes, and snippets.

@dhaniksahni
Created October 10, 2019 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhaniksahni/0f4ab616598fab9a9fd49b29508ec920 to your computer and use it in GitHub Desktop.
Save dhaniksahni/0f4ab616598fab9a9fd49b29508ec920 to your computer and use it in GitHub Desktop.
Custom Data Type for Image in Lightning Web Component
.image
{
height: 30px;
width: 30px;
}
<template>
<img src={url} alt={altText} class="image"/>
</template>
import { LightningElement,api } from 'lwc';
export default class ImageControl extends LightningElement {
@api url;
@api altText;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment