【发布时间】:2017-05-11 09:42:52
【问题描述】:
文件.ts
export class ServiceUrls {
static baseUrl: string = 'http://localhost:52949/V1/';
static baseImageUrl: string = 'http://localhost:52949/';
}
files1.ts
extends interface ServiceUrls{
static baseUrl: string = 'http://localhost:52949/V1/';
static baseImageUrl: string = 'http://localhost:52949/';
}
如何在 typescript 中实现部分类。我应该如何引用同一个类以使其像部分类一样工作。如果我在 files1.ts 中给出相同的类名,它会给出错误声明或预期的声明。
【问题讨论】:
标签: typescript partial-classes