X
X
xxvxx2021-02-02 09:56:33
Vue.js
xxvxx, 2021-02-02 09:56:33

Why doesn't reactivity work?



Select a date, add a task when I delete or edit it, reactivity does not work =((
double click on the task it is being edited
Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2021-02-02
@xxvxx

taskAdd: function () {
  if (this.dateTaskArr[this.dateActiv] == null) {
-   this.dateTaskArr[this.dateActiv] = [];
+   this.$set(this.dateTaskArr, this.dateActiv, [])
     this.dateTaskArr[this.dateActiv].push(this.taskInp);
  } else {
    this.dateTaskArr[this.dateActiv].push(this.taskInp);
  }
  this.taskInp = '';
  //console.log(this.dateTaskArr);
},

Read on the topic:
https://ru.vuejs.org/v2/guide/reactivity.html#%D0%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question