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

Function activateChildComponent

vue.js:4285–4303  ·  view source on GitHub ↗
(vm, // 虚拟dom vode
        direct //布尔值
    )

Source from the content-addressed store, hash-verified

4283
4284 //判断是否有不活跃的组件 禁用他 如果有活跃组件则触发钩子函数activated
4285 function activateChildComponent(vm, // 虚拟dom vode
4286 direct //布尔值
4287 ) {
4288 if (direct) {
4289 vm._directInactive = false;
4290 if (isInInactiveTree(vm)) { //如果有不活跃的树,或者被禁用组件
4291 return
4292 }
4293 } else if (vm._directInactive) { //单个不活跃的
4294 return
4295 }
4296 if (vm._inactive || vm._inactive === null) { //如果 _inactive=true 不活跃组件 或者 vm._inactive === null
4297 vm._inactive = false;
4298 for (var i = 0; i < vm.$children.length; i++) { //循环禁止子组件
4299 activateChildComponent(vm.$children[i]); //递归循环 禁用子组件
4300 }
4301 callHook(vm, 'activated'); //触发activated 生命周期钩子函数
4302 }
4303 }
4304
4305 // 循环子组件 和父组件 判断是否有禁止的组件 如果有活跃组件则执行生命后期函数deactivated
4306 function deactivateChildComponent(vm, direct) {

Callers 2

callActivatedHooksFunction · 0.85
vue.jsFile · 0.85

Calls 2

isInInactiveTreeFunction · 0.85
callHookFunction · 0.85

Tested by

no test coverage detected