使用 Strapi 内置插件
¥Using Strapi built-in plugins
本节从开发者的角度介绍如何使用 Strapi 内置插件。不是你要找的?阅读 插件介绍 并找到你的用例和推荐部分以从那里阅读。
¥This section is about using Strapi built-in plugins from a developer's perspective. Not what you're looking for? Read the plugins introduction and find your use case and recommended section to read from there.
内置插件
¥Built-in plugins
Strapi 附带以下内置插件,这些插件由 Strapi 核心团队官方维护和记录:
¥Strapi comes with the following built-in plugins that are officially maintained and documented by the Strapi core team:
Documentation
The Documentation plugin is useful to document the available endpoints once you created an API.
The Email plugin enables applications to send emails from a server or an external provider.
GraphQL
The GraphQL plugin adds a GraphQL endpoint to fetch and mutate your content.
Sentry
The Sentry plugin enables you to track errors in a Strapi application using Sentry.
Upload
The Upload plugin powers the Media Library found in the admin panel and allows versatile file uploads.
Users & Permissions (U&P)
The U&P plugin offers JWT-based authentication and ACL strategies for API protection and user permissions.
上传插件和用户和权限插件是默认安装的,无法卸载。
¥The Upload plugin and the Users & Permissions plugin are installed by default and can not be uninstalled.
自动插件发现
¥Automatic plugins discovery
Strapi 自动加载使用 npm 安装的插件。在底层,Strapi 扫描项目依赖的每个 package.json
文件,并查找以下声明:
¥Strapi automatically loads plugins installed with npm. Under the hood, Strapi scans every package.json
file of the project dependencies, and looks for the following declaration:
"strapi": {
"kind": "plugin"
}
也可以手动启用或禁用已安装的插件。
¥Installed plugins can also be manually enabled or disabled.
手动启用/禁用插件
¥Manual enabling/disabling of plugins
要禁用插件而不卸载它,请将 /config/plugins.ts|js
文件 中的 enabled
键切换为 false
。
¥To disable a plugin without uninstalling it, switch its enabled
key to false
in the /config/plugins.ts|js
file.