2017-03-01 90 views

回答

3

如果您導出類,那麼你不應該有問題:

file1.ts

export class File { ... } 

export class History { ... } 

file2.ts

import { File as MyFile, History as MyFistory } from "./file1"; 

let file = new MyFile(); 

or

import * as MyModule from "./file1"; 

let file = new MyModule.File(); 

如果你不使用模塊,那麼你需要重命名你的類以避免這種衝突。