mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Support reflect property "tab" (#8437)
This commit is contained in:
committed by
GitHub
parent
4c9f83bf5e
commit
2cd6091e2b
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user