5
如何构造实用程序类
我有几个实用程序功能。将它们打包然后导入的最佳方法是什么? 这就是我想要做的: import * as util from './util' export class myClass{ constructor() { util.doSomething("test"); } } 然后在课堂上: export class Util{ doSomething(val: string){ return val;} doSomethingElse(val: string{ return val;} } 我从VS得到的错误消息是: Property doSomething does not exist on type util.