MCPcopy Create free account
hub / github.com/ygs-code/vue / Dep

Function Dep

vue.js:1002–1007  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1000 */
1001 //主题对象Dep构造函数 主要用于添加发布事件后,用户更新数据的 响应式原理之一函数
1002 var Dep = function Dep() {
1003 //uid 初始化为0
1004 this.id = uid++;
1005 /* 用来存放Watcher对象的数组 */
1006 this.subs = [];
1007 };
1008
1009 Dep.prototype.addSub = function addSub(sub) {
1010 /* 在subs中添加一个Watcher对象 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected