My_Test_Repo/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingCompone...

25 lines
851 B
HTML

<template>
<lightning-card title="Conditional Rendering">
<div class="slds-m-arround_medium">
<lightning-button
variant="brand"
label="Show Data"
title="Show Data"
onclick={handleClick}
class="slds-m-left_x-small">
</lightning-button>
<template if:true={isVisible}>
<p>Data is visible</p>
</template>
<template if:false={isVisible}>
<p>Data is not visible</p>
</template>
<lightning-input type="text" label="Type hello to see data" onkeyup={handleInputChange}></lightning-input>
<template if:true={helloName}>
<h2>you types right </h2>
</template>
</div>
</lightning-card>
</template>