feat:add maxWidth and maxHeight for text

This commit is contained in:
pengfei.zhou
2020-03-23 16:23:41 +08:00
committed by osborn
parent 7f16aa23ae
commit fe33a18213
11 changed files with 89 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ export interface IText extends IView {
textAlignment?: Gravity;
fontStyle?: "normal" | "bold" | "italic" | "bold_italic";
font?: string;
maxWidth?: number;
maxHeight?: number;
}
export declare class Text extends View implements IText {
text?: string;
@@ -18,5 +20,7 @@ export declare class Text extends View implements IText {
textAlignment?: Gravity;
fontStyle?: "normal" | "bold" | "italic" | "bold_italic";
font?: string;
maxWidth?: number;
maxHeight?: number;
}
export declare function text(config: IText): Text;

View File

@@ -56,6 +56,14 @@ __decorate([
Property,
__metadata("design:type", String)
], Text.prototype, "font", void 0);
__decorate([
Property,
__metadata("design:type", Number)
], Text.prototype, "maxWidth", void 0);
__decorate([
Property,
__metadata("design:type", Number)
], Text.prototype, "maxHeight", void 0);
export function text(config) {
const ret = new Text;
ret.layoutConfig = layoutConfig().fit();