(
vnode,
toggleDisplay
)
| 11132 | |
| 11133 | //resolveTransition 解析vonde中的transition的name属性获取到一个css过度对象类 |
| 11134 | function enter( |
| 11135 | vnode, |
| 11136 | toggleDisplay |
| 11137 | ) { |
| 11138 | var el = vnode.elm; //真实的dom |
| 11139 | |
| 11140 | |
| 11141 | |
| 11142 | // call leave callback now 执行 leave 回调函数 |
| 11143 | if (isDef(el._leaveCb)) { |
| 11144 | el._leaveCb.cancelled = true; //标志已经执行过_leaveCb函数 |
| 11145 | el._leaveCb(); //执行_leaveCb回调 |
| 11146 | } |
| 11147 | //resolveTransition 解析vonde中的transition的name属性获取到一个css过度对象类 |
| 11148 | var data = resolveTransition(vnode.data.transition); |
| 11149 | console.log(vnode.data.transition) |
| 11150 | console.log(data) |
| 11151 | |
| 11152 | if (isUndef(data)) { |
| 11153 | return |
| 11154 | } |
| 11155 | |
| 11156 | /* istanbul ignore if */ |
| 11157 | if (isDef(el._enterCb) || el.nodeType !== 1) { //不是真实的dom |
| 11158 | return |
| 11159 | } |
| 11160 | |
| 11161 | var css = data.css; //css类 |
| 11162 | var type = data.type; //dom类型 |
| 11163 | var enterClass = data.enterClass; //动画进入中的 css 中的过度类 |
| 11164 | var enterToClass = data.enterToClass; //动画退出中的 css 中的过度类 |
| 11165 | var enterActiveClass = data.enterActiveClass; //动画进入活跃的类 类似这样的 enter-active {transition: all .3s ease;} |
| 11166 | var appearClass = data.appearClass; // 自定义动画props属性 过度 |
| 11167 | var appearToClass = data.appearToClass; //自定义动画props属性 离开的过度 css 类名 |
| 11168 | var appearActiveClass = data.appearActiveClass;//自定义动画props属性 激活 css 类名 |
| 11169 | var beforeEnter = data.beforeEnter; //进入动画钩子函数 |
| 11170 | var enter = data.enter;//进入动画钩子函数 |
| 11171 | var afterEnter = data.afterEnter; //进入动画钩子函数 |
| 11172 | var enterCancelled = data.enterCancelled;//进入动画钩子函数 |
| 11173 | var beforeAppear = data.beforeAppear; //自定义过过度动画的钩子函数 |
| 11174 | var appear = data.appear; //自定义过度动画的 属性名称 |
| 11175 | var afterAppear = data.afterAppear; //自定义过度动画的 钩子函数 |
| 11176 | var appearCancelled = data.appearCancelled; //自定义过度动画的 钩子函数 |
| 11177 | var duration = data.duration; //定义动画的时长 |
| 11178 | |
| 11179 | // activeInstance will always be the <transition> component managing this |
| 11180 | // transition. One edge case to check is when the <transition> is placed |
| 11181 | // as the root node of a child component. In that case we need to check |
| 11182 | // <transition>'s parent for appear check. |
| 11183 | //activeInstance始终是管理这个的<transition>组件 |
| 11184 | //转换。要检查的一种边缘情况是何时放置<transition> |
| 11185 | //作为子组件的根节点。那样的话,我们需要检查一下 |
| 11186 | // <切换到>的父节点以查看是否出现。 |
| 11187 | var context = activeInstance; //vue 实例化的对象 |
| 11188 | var transitionNode = activeInstance.$vnode; // 父层的Vnode |
| 11189 | while (transitionNode && transitionNode.parent) { //循环父层vonde 一直到顶层的 vonde |
| 11190 | transitionNode = transitionNode.parent; |
| 11191 | context = transitionNode.context; |
no test coverage detected