vuejs中的watch监听属性

watch: {
    // 如果 `question` 发生改变,这个函数就会运行 ,newQuestion改变时的值,
oldQuestion是没改变的值 question: function (newQuestion, oldQuestion) { this.answer = 'Waiting for you to stop typing...' this.debouncedGetAnswer() } },

  

posted @ 2021-01-21 10:09  小林不会飞  阅读(259)  评论(0编辑  收藏  举报