我们通过一个接口来扩展类型批注。
1,我们修改index.html的js文件为interface.js。

interface文件的内容如下

接口可以作为一个类型批注


当我们缺省name参数是,编译的过程中会报错



我们通过一个接口来扩展类型批注。
1,我们修改index.html的js文件为interface.js。
interface文件的内容如下
接口可以作为一个类型批注
当我们缺省name参数是,编译的过程中会报错
本文标题:TypeScript---interface
本文链接:https://www.haomeiwen.com/subject/rvlurqtx.html
网友评论