Support reflect property "tab" (#8437)

This commit is contained in:
Leslie Leigh (李的序)
2021-04-16 15:37:47 +08:00
committed by GitHub
parent 4c9f83bf5e
commit 2cd6091e2b
3 changed files with 21 additions and 1 deletions
+1
View File
@@ -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');
}
+12
View File
@@ -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.
+8 -1
View File
@@ -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;
/**
*
*/