Skip to content

Instantly share code, notes, and snippets.

@TheVishnuKumar
Created January 3, 2019 04:04
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 TheVishnuKumar/2c0a838dadbc353f9fe6464f4000a4e7 to your computer and use it in GitHub Desktop.
Save TheVishnuKumar/2c0a838dadbc353f9fe6464f4000a4e7 to your computer and use it in GitHub Desktop.
<template>
<template if:true={showTom}>
<img src="https://vignette.wikia.nocookie.net/tomandjerry/images/3/33/Tom_cat.png/revision/latest?cb=20111113021359"/>
</template>
<template if:false={showTom}>
<img src="http://pngimg.com/uploads/tom_and_jerry/tom_and_jerry_PNG56.png"/>
</template>
</template>
import { LightningElement } from 'lwc';
export default class HelloConditionalRendering extends LightningElement {
showTom = false;
}
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="TomAndJerry">
<apiVersion>45.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment