MCPcopy Index your code
hub / github.com/ygs-code/vue / getData

Function getData

vue.js:5020–5035  ·  view source on GitHub ↗
(data, vm)

Source from the content-addressed store, hash-verified

5018
5019 //转换数据 如果数据是 一个函数的时候 执行该函数 拿到数据
5020 function getData(data, vm) {
5021 // #7573 disable dep collection when invoking data getters
5022 //调用数据getter时禁用dep收集
5023 pushTarget();
5024 try {
5025 //执行函数 获取数据
5026 return data.call(vm, vm)
5027 } catch (e) {
5028 //收集错误信息
5029 handleError(e, vm, "data()");
5030 return {}
5031 } finally {
5032 //调用数据getter时禁用dep收集
5033 popTarget();
5034 }
5035 }
5036
5037 var computedWatcherOptions = { lazy: true };
5038

Callers 1

initDataFunction · 0.85

Calls 3

pushTargetFunction · 0.85
handleErrorFunction · 0.85
popTargetFunction · 0.85

Tested by

no test coverage detected