[Vuejs]-Reload component real time when adding an item to an array. Vue.js

1👍

I assume that your model has no parameter questionOptions.
Assigning this.form = _.cloneDeep(model) you makes your form reactive, but then this.form.questionOptions = model.survey_question_option makes parameter questionOptions not reactive:

You can do this way:

// modify your model object
model = _.cloneDeep(model);
if (model.optional === 1) {
    model.optional = true;
}
if (model.show_text === 1) {
    model.show_text = true;
}
model.questionOptions = model.survey_question_option;
// make it reactive
this.form = model;

this.dialogFormVisible = true;

if (this.form.image || this.form.video) {
    this.active = '1';
} else if (!this.form.image && !this.form.video) {
    this.active = '';
}
👤Darius

Leave a comment