2017/2/4
目的是什么
是 ES6 ?
是 TypeScript ? (貌似看起来不是)
其他黑魔法 ?
发现的带强类型标记的代码
export function cloneVNode (vnode: VNode): VNode {
// ??? 这里
const cloned = new VNode(
vnode.tag,
vnode.data,
vnode.children,
vnode.text,
vnode.elm,
vnode.context,
vnode.componentOptions
)
cloned.ns = vnode.ns
cloned.isStatic = vnode.isStatic
cloned.key = vnode.key
cloned.isCloned = true
return cloned
}
export function cloneVNodes (vnodes: Array<VNode>): Array<VNode> {
// ??? 这里
const res = new Array(vnodes.length)
for (let i = 0; i < vnodes.length; i++) {
res[i] = cloneVNode(vnodes[i])
}
return res
}
github位置: https://github.com/vuejs/vue/...
猜测
另一种强类型标记 ? ( 给某个工具看的 ? )
搜索了
vuejs use es 6?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
不是,之前回答过。
这个是fb出的一个强类型的静态检查工具 Flow
直接去看依赖吧
https://github.com/vuejs/vue/...
const? es6的常量。
评论里说的应该是对的。