Answer the question
In order to leave comments, you need to log in
How to get v-for list item in VueJs?
On a very old project, I use vue in conjunction with jquery.
When adding dynamic elements through v-for, you need to bind jquery only to the elements of this block.
In my example, the datepicker is rebinded on the entire page, to the rendered block.
addNewTemplate() {
let newTemplate = this.bankingTemplates[this.selectedNewTemplate];
newTemplate.entry_date = moment().format('DD.MM.YYYY');
newTemplate.invoice_date = moment().format('DD.MM.YYYY');
if (newTemplate) {
this.rows.push(newTemplate);
}
this.$nextTick(function () {
$(".datepicker").datepicker();
});
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question