Advertisement
airton-junior

LWC - meuPrimeiroComponente

Apr 5th, 2023
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!--Arquivo html-->
  2. <template>
  3.   <lightning-card  title="Input com evento" icon-name="custom:custom44">
  4.     <div class="slds-var-m-around_medium">
  5.       <p class="estilo">Olá, {greeting}!</p>
  6.       <lightning-input type="text" value={greeting} onchange={changeHandler} label="Escreva algo"></lightning-input>
  7.     </div>
  8.   </lightning-card>
  9. </template>
  10.  
  11. //Arquivo javascript
  12. import { LightningElement } from 'lwc';
  13.  
  14. export default class PrimeiroComponente extends LightningElement {
  15.   greeting = 'Mundo';
  16.  
  17.   changeHandler(event){
  18.     this.greeting = event.target.value;
  19.   }
  20. }
  21.  
  22. <!--Arquivo XML-->
  23.     <targets>
  24.         <target>lightning__HomePage</target>
  25.         <target>lightning__RecordPage</target>
  26.         <target>lightning__AppPage</target>
  27.     </targets>
  28.     <targetConfigs>
  29.         <targetConfig targets="lightning__RecordPage">
  30.             <objects>
  31.                 <object>Account</object>
  32.                 <object>Contact</object>
  33.                 <object>Opportunity</object>
  34.             </objects>
  35.         </targetConfig>
  36.     </targetConfigs>
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement