How Vue Updates Template / Component

Vue only updates if it tracks some reactive data in the template

by darkylmnx

HTML

<div id="app">
  <p>hello {{ nb }}</p>
  <p><button @click="nb++">force re-render</button></p>
</div>

Vue

new Vue({
	el: '#app',
  
  data: {
  	nb: 0
  },
  
  updated() {
  	alert('You WILL SEE me because there is data in the teplate')
  }
})