摘要: createElement export function createElement ( context: Component, // 传入的vm实例 tag: any, // tag标签 data: any, // 跟vnode相关的数据 children: any, // vnode的子节点 阅读全文
posted @ 2022-04-07 22:29 upupupupupgo 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 泛型 泛型(Generics)是指在定义函数、接口或类的时候,不预先指定具体的类型,而在使用的时候再指定类型的一种特性。 简单的例子 首先,我们来实现一个函数createArray,它可以创建一个指定长度的数组,同时将每一项都填充一个默认值: function createArray(length: 阅读全文
posted @ 2022-04-07 11:27 upupupupupgo 阅读(34) 评论(0) 推荐(0) 编辑