一介*书生
愿你熬过苦难,依旧努力生活。
摘要: 1.TS内置高级类型Partial&Pick&Required&Readonly 1.1、Partial Partial 可以快速把某个接口类型中定义的所有属性变成可选的 interface ApiKey { id: number; name: string; } const dataType1: 阅读全文
posted @ 2023-02-21 18:11 一介-_-书生 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1.什么是声明 当使用第三方库时,很多三方库不是用 TS 写的,我们需要引用它的声明文件,才能获得对应的代码补全、接口提示等功能。 比如,在 TS 中直接使用 Vue,就会报错, const app = new Vue({ el: '#app', data: { message: 'Hello Vu 阅读全文
posted @ 2023-02-21 15:31 一介-_-书生 阅读(514) 评论(0) 推荐(0) 编辑