vuejs中的watch监听属性
watch: {
// 如果 `question` 发生改变,这个函数就会运行 ,newQuestion改变时的值,
oldQuestion是没改变的值
question: function (newQuestion, oldQuestion) {
this.answer = 'Waiting for you to stop typing...'
this.debouncedGetAnswer()
}
},
踩过这个坑,还有下一个坑等着你,这一路就是给自己填坑,坑填多了,也就习惯了,直到这一路平坦了,也就无怨无悔了。

浙公网安备 33010602011771号