1. 首页
  2. 编程语言
  3. Javascript
  4. Vue中computed和watch有哪些区别

Vue中computed和watch有哪些区别

上传者: 2021-09-01 13:15:55上传 PDF文件 74.15 KB 热度 25次

不应该使用箭头函数来定义 watcher 函数,因为箭头函数没有 this,它的 this 会继承它的父级函数,但是它的父级函数是 window,导致箭头函数的 this 指向 window,而不是 Vue 实例

下载地址
用户评论