111
沙世明
2022-11-22 928399eceec50e3d37ea08669a12789a9410a9d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { LightningElement, track, wire,api } from 'lwc';
 
import NAME_FIELD from '@salesforce/schema/Account.Name';
import REVENUE_FIELD from '@salesforce/schema/Account.AnnualRevenue';
import INDUSTRY_FIELD from '@salesforce/schema/Account.Industry';
 
export default class aaaIWCTest5 extends LightningElement {
    @api name="jone";
    @track greeting = 'World';
    @track showDetail = false;
    @track inputValue1='';
 
     handleChange(event) {
         this.greeting = event.target.value;
         if(this.greeting.toLocaleLowerCase() === 'xx') {
             this.showDetail = true;
         } else {
             this.showDetail = false;
         }
     }
     
     handleChangeEvent(event){
        this.inputValue1='快叫爹';
        if(this.template.querySelector('lightning-input').checkValidity()){
            this.template.querySelector('lightning-input').setCustomValidity('');
            this.template.querySelector('lightning-input').reportValidity();
        }
 
     }
}