Vue->methods、computed与watch之间的区别

computed只有当页面数据变化时才会计算,当数据没有变化时,它会读取缓存。

而watch每次都需要执行函数,methods也是每次都需要执行

进行异步操作的时候比较适合watch

computed

分类:
前端