• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Vue.JS by
Q:
What are the array detection mutation methods in VueJS?

1 Answer

0 votes
by
As the name suggests, mutation methods modifies the original array. Below are the list of array mutation methods which trigger view updates.

push()

pop()

shift()

unshift()

splice()

sort()

reverse()

If you perform any of the above mutation method on the list then it triggers view update. For example, push method on array named 'items' trigger a view update,

vm.todos.push({ message: 'Baz' })

Related questions

0 votes
asked Feb 4, 2020 in Vue.JS by rajeshsharma
0 votes
asked Feb 4, 2020 in Vue.JS by rajeshsharma
...