export class Cloud implements CloudSdkInterface {
/**
* This method should be overwrite
* @returns
*/
static create: () => CloudSdkInterface
private _cloud: CloudSdkInterface
private get cloud(): CloudSdkInterface {
if (!this._cloud) {
this._cloud = Cloud.create()
}
return this._cloud
}
fetch: AxiosStatic = request
}
```
const cloud = new Cloud()
export default cloud 导出类并实例化
初始化 cloud方便内部调用,如果不存在cloud则调用内部的静态方法create创建.
那么在外部引入使用
import cloud from ‘@lafjs/cloud’
cloud.fetch()