提交 8f9c1256 编写于 作者: Q qiang

docs: update uts type

上级 6fc4ba7d
......@@ -34,13 +34,13 @@ function greet(person: { name: string, printName: () => void }) {
正确的用法:
```ts
greet({ name: 'Tom', printName: () => { console.log(this.name) } } as Person)
greet({ name: 'Tom', printName: function () { console.log(this.name) } } as Person)
```
类型不匹配:
```ts
greet({ name: 'Tom', printName: () => { console.log(this.name) } })
greet({ name: 'Tom', printName: function () { console.log(this.name) } })
```
## 嵌套限制
......
......@@ -35,6 +35,6 @@ const p: Person = new P('Tom')
```ts
type Person = {
name: string
age: number
printName: () => void
}
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册