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

Function deactivateChildComponent

vue.js:4306–4321  ·  view source on GitHub ↗
(vm, direct)

Source from the content-addressed store, hash-verified

4304
4305 // 循环子组件 和父组件 判断是否有禁止的组件 如果有活跃组件则执行生命后期函数deactivated
4306 function deactivateChildComponent(vm, direct) {
4307 if (direct) {
4308 vm._directInactive = true;
4309 if (isInInactiveTree(vm)) {
4310 return
4311 }
4312 }
4313 if (!vm._inactive) { //如果该组件是活跃的
4314 vm._inactive = true; //设置活动中的树
4315 for (var i = 0; i < vm.$children.length; i++) {
4316 deactivateChildComponent(vm.$children[i]);
4317 }
4318 //执行生命周期函数deactivated
4319 callHook(vm, 'deactivated');
4320 }
4321 }
4322
4323 //触发钩子函数
4324 function callHook(vm, //虚拟dom vonde

Callers 1

vue.jsFile · 0.85

Calls 2

isInInactiveTreeFunction · 0.85
callHookFunction · 0.85

Tested by

no test coverage detected