S
S
stimul7772021-09-08 14:19:55
Vue.js
stimul777, 2021-09-08 14:19:55

Why is it not binding in the v-model loop?

Hello everyone, there is a cycle in the template, I'm trying to bind the input to the object through which iteration passes, but it is not attached. We need to make sure that when characters are entered into the input, the parent we are iterating over is also updated. How to do it? thank.
ps. the loop in the ui-grid component happens, the array for the loop gets there through props :items="item.cart.nomenclature"

<ui-grid
                    :headers="headersTable"
                    :items="item.cart.nomenclature"
                    :loading="false"
                    :colorAlternation="true"
                  >
                    <!-- Наименование товара -->
                    <template #col.title="{ item }">
                      <div>{{ item }}</div>
                    </template>
                    <!-- ЕИ -->
                    <template #col.unitType="{ item }">
                      <div>{{ item }}</div>
                    </template>
                    <!-- План -->
                    <template #col.nomenclatureQuantity="{ item }">
                      <div>{{ item }}</div>
                    </template>
                    <!-- Факт единицы ВОТ ТУТ, НАПРИМЕР, НЕТ ПРИВЯЗКИ -->
                    <template #col.factUnit="{ item, items }">
                      <ui-input
                        :height="30"
                        :type="'number'"
                        v-model="items.factUnit"
                        :value="items.factUnit"
                        @input="divergenceCalc(items)"
                      />
                      <input
                        v-model="items.factUnit"
                        placeholder="отредактируй меня"
                      />
                    </template>
                    <!-- Факт упаковки -->
                    <template #col.packingFact="{ item, items }">
                      <ui-input
                        :height="30"
                        :type="'number'"
                        v-model="items.packingFact"
                      />
                    </template>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question