0

I have a question, cuz i have two components, my parent and childe. Child component contains all types of input, and this imputs throwing new customEvent onchange so every single time when i type sth in input its overiding my variable.

The point is, that i have several inputs from child component and i need to collect all the date from them. for example add button and onClick action i would like to collect data from child component, how to do this easly ?

This is HTML file

    <template if:true={filter.isButton}>
        <c-config-input key={filter.name}  onclick={handleClick} field-info={filter} field-name={filter.fieldName} picklist-options={filter} ></c-lwc01_code-config-input>
    </template>
    <template if:false={filter.isButton}>
        <c-config-input key={filter.name} oninputchange={handleInputChange} field-info={filter} field-name={filter.fieldName} picklist-options={filter}></c-lwc01_code-config-input>
    </template>
</template>

Here is JS

handleInputChange(event){

   this.name= event.detail.name;
   this.value = event.detail.value;

}
 handleClick(event) {
   var temp = this.template.querySelectAll(["c-config-input"]).value;
 }
  • Can you add the minimal code snippet which you have tried so far? – sanket kumar Mar 25 at 8:04
  • Yeah, i updated – artist Mar 25 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.