2 Star 1 Fork 1

sixlty/vue解析

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
object.keys.html 2.13 KB
一键复制 编辑 原始数据 按行查看 历史
qq281113270 提交于 2019-03-28 14:29 . Add files via upload
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
var componentVNodeHooks = {
init: function init(
vnode, //vonde虚拟dom
hydrating,
parentElm,
refElm) {
if (
vnode.componentInstance && !vnode.componentInstance._isDestroyed &&
vnode.data.keepAlive
) {
// kept-alive components, treat as a patch
var mountedNode = vnode; // work around flow
} else {
}
},
prepatch: function prepatch(oldVnode, vnode) {
var options = vnode.componentOptions;
var child = vnode.componentInstance = oldVnode.componentInstance;
},
insert: function insert(vnode) {
var context = vnode.context;
var componentInstance = vnode.componentInstance;
if (!componentInstance._isMounted) {
componentInstance._isMounted = true;
callHook(componentInstance, 'mounted');
}
if (vnode.data.keepAlive) {
if (context._isMounted) {
// vue-router#1212
// During updates, a kept-alive component's child components may
// change, so directly walking the tree here may call activated hooks
// on incorrect children. Instead we push them into a queue which will
// be processed after the whole patch process ended.
} else {
}
}
},
destroy: function destroy(vnode) {
var componentInstance = vnode.componentInstance;
if (!componentInstance._isDestroyed) {
if (!vnode.data.keepAlive) {
componentInstance.$destroy();
} else {
}
}
}
};
var hooksToMerge = Object.keys(componentVNodeHooks);
console.log(hooksToMerge)
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sixlty/vue-parsing.git
[email protected]:sixlty/vue-parsing.git
sixlty
vue-parsing
vue解析
master

搜索帮助