Home  >  Q&A  >  body text

Vue method to pass multiple input values ​​from child component to parent component

** Anyone know how to pass multiple child components. input value**

<template>
  <div>
    <v-row align="center">
      <v-select
        :items="languages"
        v-model="selectedOption"
        @input="changeLanguage()"
        outlined
        solo
        class="m-3"
        cols="12"
        sm="2"
        label="Select Language"
      ></v-select>

      <v-combobox
        @input-content="changeContent()"
        v-model="contents2"
        outlined
        solo
        class="d-inline-flex"
        cols="12"
        sm="2"
        label="Input Content"
      ></v-combobox>
    </v-row>
  </div>
</template>

**The above is my Template folder, please feel free to ask me for more source code**

<Child
        v-for="count in sec"
        :key="count"
        v-model="selectedLanguage"
        :languages="languages"
        :contents="contents"
        :input="onChangeChild"
        :inputContent="onChangeContent"
      />

** This is my parent component source code **

P粉476475551P粉476475551206 days ago318

reply all(1)I'll reply

  • P粉216203545

    P粉2162035452024-03-27 15:36:45

    It seems you already know what you want and need. and possess skills that enhance problem-solving approaches.

    Parent properties can be used as v-models on deeper components.

    You can also split the component into multiple if you need to thoroughly manage certain values. If this doesn't cost you more testing or any other resources.

    when

    reply
    0
  • Cancelreply