mirror of
https://github.com/wangdoc/typescript-tutorial.git
synced 2025-12-20 16:55:06 +08:00
docs(function): edit function overload
This commit is contained in:
@@ -889,7 +889,7 @@ type CreateElement = {
|
||||
}
|
||||
```
|
||||
|
||||
由于重载是一种比较复杂的类型声明方法,为了降低复杂性,一般来说,如果可以的话,应该优先使用联合类型替代函数重载。
|
||||
由于重载是一种比较复杂的类型声明方法,为了降低复杂性,一般来说,如果可以的话,应该优先使用联合类型替代函数重载,除非多个参数之间、或者某个参数与返回值之间,存在对应关系。
|
||||
|
||||
```typescript
|
||||
// 写法一
|
||||
|
||||
Reference in New Issue
Block a user