buli
2023-07-10 f05bfc9a39bccc8afb928efe7555f21e0e69c5bd
force-app/main/default/lwc/customUnitComp/customUnitComp.js
@@ -1,4 +1,4 @@
import { LightningElement, api } from 'lwc';
import { LightningElement,api } from 'lwc';
export default class CustomUnitComp extends LightningElement {
    @api unitValue;
@@ -6,24 +6,22 @@
    @api recordId;
    @api isDisabled;
    connectedCallback() {
        if (this.isDisabled == null) {
    connectedCallback(){
        if(this.isDisabled == null){
            this.isDisabled = false;
        }
    }
    handleDataChange(event) {
    handleDataChange(event){
        console.log('unitValue = ' + event.target.value);
        this.unitValue = event.target.value;
        this.dispatchEvent(
            new CustomEvent('unitchange', {
                composed: true,
                bubbles: true,
                cancelable: true,
                detail: {
                    data: { unitValue: this.unitValue, recordId: this.recordId }
                }
            })
        );
        this.dispatchEvent(new CustomEvent('unitchange', {
            composed: true,
            bubbles: true,
            cancelable: true,
            detail: {
                data: { unitValue: this.unitValue, recordId: this.recordId }
            }
        }));
    }
}