diff --git a/cocos/core/data/class.ts b/cocos/core/data/class.ts index 8978a98006..8140458f39 100644 --- a/cocos/core/data/class.ts +++ b/cocos/core/data/class.ts @@ -579,6 +579,7 @@ function parseAttributes (constructor: Function, attributes: IAcceptableAttribut (attrs || initAttrs())[`${propertyNamePrefix}readonly`] = attributes.readonly; } parseSimpleAttribute('tooltip', 'string'); + parseSimpleAttribute('tab', 'string'); parseSimpleAttribute('slide', 'boolean'); parseSimpleAttribute('unit', 'string'); } diff --git a/cocos/core/data/decorators/editable.ts b/cocos/core/data/decorators/editable.ts index cbb8a9d53f..941912d2ff 100644 --- a/cocos/core/data/decorators/editable.ts +++ b/cocos/core/data/decorators/editable.ts @@ -198,6 +198,18 @@ export const tooltip: (text: string) => LegacyPropertyDecorator = !DEV ? emptyDe tooltip: text, })); +/** + * @en + * Sets the tab where this property is organized into, on property inspector. + * @zh + * 设置在属性检查器上该属性所属的分类标签。 + * @param tabName 标签名。 + */ +export const tab: (tabName: string) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn + : (tabName) => property(makeEditable({ + tab: tabName, + })); + /** * @en * Sets the allowed range of the property in editor. diff --git a/cocos/core/data/utils/attribute-defines.ts b/cocos/core/data/utils/attribute-defines.ts index c6fa525e9f..4e15d5ff04 100644 --- a/cocos/core/data/utils/attribute-defines.ts +++ b/cocos/core/data/utils/attribute-defines.ts @@ -45,10 +45,17 @@ export interface IExposedAttributes { displayOrder?: number; /** - * 该属性在编辑器中的工具提示内容。 + * @en Editor tooltip of this property. + * @zh 该属性在编辑器中的工具提示内容。 */ tooltip?: string; + /** + * @en The tab name where this property is organized into, on property inspector. + * @zh 在属性检查器上该属性所属的分类标签名。 + */ + tab?: string; + /** * */