search

Home  >  Q&A  >  body text

vue.js - How Vue monitors data changes like Angular.js watch

For example, I monitor the content in an input box,

Execute a function when the data changes, otherwise execute another function.

世界只因有你世界只因有你2782 days ago858

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 17:09:33

    new Vue({
        watch: {
            name: function(newValue, oldValue){
            }
        }
    })

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-15 17:09:33

    Vue’s responsiveness is the ob.observe() method, and there is no need for dirty monitoring methods like watch.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-15 17:09:33

    vue also has watch method, see http://cn.vuejs.org/guide/com...

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-15 17:09:33

    Vue provides a more general method to reflect data changes through watch settings

    reply
    0
  • Cancelreply