nocobase/docs/tr-TR/api/client/application.md
altaytahsin ad4929e48b
Turkish language created for Docs. Belgeler için türkçe dil desteği (#1071)
* Turkish language created for Docs. Belgeler için türkçe dil desteği oluşturuldu.

* Turkish docs fix
2022-12-23 09:42:44 +08:00

1005 B
Raw Blame History

Application

构造函数

constructor()

创建一个应用实例。

签名

  • constructor(options: ApplicationOptions)

示例

const app = new Application({
  apiClient: {
    baseURL: process.env.API_BASE_URL,
  },
  dynamicImport: (name: string) => {
    return import(`../plugins/${name}`);
  },
});

方法

use()

添加 Providers内置 Providers 有:

  • APIClientProvider
  • I18nextProvider
  • AntdConfigProvider
  • RemoteRouteSwitchProvider
  • SystemSettingsProvider
  • PluginManagerProvider
  • SchemaComponentProvider
  • SchemaInitializerProvider
  • BlockSchemaComponentProvider
  • AntdSchemaComponentProvider
  • ACLProvider
  • RemoteDocumentTitleProvider

render()

渲染 App 组件

import { Application } from '@nocobase/client';

export const app = new Application({
  apiClient: {
    baseURL: process.env.API_BASE_URL,
  },
  dynamicImport: (name: string) => {
    return import(`../plugins/${name}`);
  },
});

export default app.render();