说我有2个接口:
interface Interface1{}
interface Interface2{}
Run Code Online (Sandbox Code Playgroud)
有没有办法将属性声明为实现两个接口?就像是:
class MyClass{
public p: Interface1, Interface2
}
Run Code Online (Sandbox Code Playgroud)
有没有办法将属性声明为实现两个接口?就像是:
对.安intersection type:
interface Interface1{}
interface Interface2{}
class MyClass{
public p: Interface1 & Interface2
}
Run Code Online (Sandbox Code Playgroud)
这包括在这里https://basarat.gitbooks.io/typescript/content/docs/types/type-system.html
| 归档时间: |
|
| 查看次数: |
3472 次 |
| 最近记录: |