Answer the question
In order to leave comments, you need to log in
How to make multiple edit box in Vue?
Good afternoon everyone.
I am making a multiple field.
<v-layout row wrap justify-center>
<v-flex xs7>
<div v-for="company in form.company_ids" :key="company.id">
<v-text-field
v-model="company.id"
></v-text-field>
</div>
</v-flex>
<v-flex text-xs-center xs7>
<v-btn color="success" @click="addCompany">
Добавить компанию
</v-btn>
</v-flex>
</v-layout>
addCompany() {
this.form.company_ids.push({});
}
Answer the question
In order to leave comments, you need to log in
when you enter each character from the field, the focus flies
this.form.company_ids.push({
key: this.form.company_ids.length,
});
this.form.company_ids.push({
key: ++this.currKey,
});
this.form.company_ids.push({
key: Math.max(0, ...this.form.company_ids.map(n => n.key)) + 1,
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question