我尝试在单个命名空间但在多个文件中编写打字稿代码。config但是当我在类中使用该类时AAA,Config未定义并且存在语法错误。为什么?
检查这个例子:
file: services/Config/index.ts:
export namespace Services {
export class Config {
/* class methods */
}
}
Run Code Online (Sandbox Code Playgroud)
file: services/AAA/index.ts:
/// <reference path = "./../Config/index.ts" />
export namespace Service {
export class AAAA {
private config = new Config(); <-- Error is here
/* class methods */
}
}
Run Code Online (Sandbox Code Playgroud) 在某些组件中,当我使用 ref 回调来接收组件的 ref 时,回调的参数为 null。何时以及在什么情况下参数将为空?