# injectContentManagerComponent() 已移除

> Source: https://strapi.nodejs.cn/cms/migration/v4-to-v5/breaking-changes/inject-content-manager-component

🌐 `injectContentManagerComponent()` removed

`injectContentManagerComponent()` 方法在 Strapi 5 中被移除，并被 `getPlugin('content-manager').injectComponent()` 替代，因为内容管理器现在是一个插件。

🌐 The `injectContentManagerComponent()` method is removed in Strapi 5 and replaced with `getPlugin('content-manager').injectComponent()` since the Content Manager is now a plugin.

在 Strapi 5 中，`injectContentManagerComponent` 方法被移除，因为内容管理器现在是一个插件。[管理面板 API](/cms/plugins-development/admin-injection-zones) 方法被 `getPlugin('content-manager').injectComponent()` 替代。

🌐 In Strapi 5, the `injectContentManagerComponent` method is removed because the Content Manager is now a plugin. The [Admin Panel API](/cms/plugins-development/admin-injection-zones) method is replaced by `getPlugin('content-manager').injectComponent()`.

此页面是[重大更改数据库](/cms/migration/v4-to-v5/breaking-changes)的一部分，提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。

🌐 This page is part of the [breaking changes database](/cms/migration/v4-to-v5/breaking-changes) and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

- Is this breaking change affecting plugins? Yes
- Is this breaking change automatically handled by a codemod? No

## 重大变更描述 {#breaking-change-description}

🌐 Breaking change description

**在 Strapi v4 中**

组件注入内容管理器如下：

🌐 A component is injected into the Content Manager as follows:

```tsx
app.injectContentManagerComponent('editView', 'right-links', {
    name: 'PreviewButton',
    Component: () => (
      window.alert('Not here, The preview is.')}>Preview
    ),
  });
```

**在 Strapi 5 中**

组件注入内容管理器如下：

🌐 A component is injected into the Content Manager as follows:

```tsx
app.getPlugin('content-manager').injectComponent('editView', 'right-links', {
    name: 'PreviewButton',
    Component: () => (
      window.alert('Not here, The preview is.')}>Preview
    ),
  });
```

### 迁移步骤 {#migration-steps}

🌐 Migration steps

将你的插件 `index.ts` 文件从：

🌐 Change your plugin `index.ts` file from:

  ```js
  app.injectContentManagerComponent()
  ```

到以下：

🌐 to the following:

  ```tsx
  app.getPlugin('content-manager').injectComponent()
  ```
