Skip to main content

lockIcon 属性已被 licenseOnly 替代

🌐 lockIcon property replaced by licenseOnly

Strapi 5 添加了一个新的 licenseOnly 布尔属性,用于在 addSettingsLinkaddSettingsLinks 操作中传递 addMenuLink。添加此属性会在链接附近显示一个闪电 ⚡️ 图标,并表示付费功能。

🌐 Strapi 5 adds a new licenseOnly boolean property to pass in the addMenuLink, in the addSettingsLink and in the addSettingsLinks actions. Adding this property shows a lightning ⚡️ icon near the link, and indicates paid features.

在 Strapi v4 中,通过添加 lockIcon 属性可以实现类似的结果。

🌐 A similar result can be achieved in Strapi v4 by adding the lockIcon property.

此页面是重大更改数据库的一部分,提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。

🌐 This page is part of the breaking changes database 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

在 Strapi v4 中

  • lockIcon 属性在管理面板 API 的 addMenuLink()addSettingsLinkaddSettingsLinks() 方法中使用。
  • 该属性添加了一个锁定图标。

在 Strapi 5 中

  • licenseOnly 属性在管理面板 API 的 addMenuLink()addSettingsLinkaddSettingsLinks() 方法中使用。
  • 该属性添加了一个闪电图标⚡️。

迁移

🌐 Migration


注意

🌐 Notes

  • 传入 licenseOnly: true 将添加一个闪电图标 ⚡️,这样:
    • 菜单图标将如下所示:
    • 设置菜单项将如下所示:
  • 有关如何使用 licenseOnly 属性的更多信息和示例,可以在管理面板 API 文档的 addMenuLink()addSettingsLink()addSettingsLinks() 方法部分找到。

手动迁移

🌐 Manual migration

如果你的自定义 Strapi v4 代码使用 lockIcon 属性来标记需要 GrowthThis feature is available with a Growth plan.EnterpriseThis feature is available with an Enterprise plan. 计划的付费功能,请搜索并将 lockIcon: true 替换为 licenseOnly: true