From 09b9aeb48a3dabcebbd8595243feec590f350f65 Mon Sep 17 00:00:00 2001 From: luoying_ace_admin Date: Tue, 6 Sep 2022 15:00:22 +0800 Subject: [PATCH] fix docs Signed-off-by: luoying_ace_admin --- .../arkui-ts/ts-basic-components-gauge.md | 2 +- .../arkui-ts/ts-drawing-components-circle.md | 26 ++++++++----- .../arkui-ts/ts-drawing-components-ellipse.md | 28 +++++++------ .../arkui-ts/ts-drawing-components-line.md | 26 ++++++++----- .../arkui-ts/ts-drawing-components-path.md | 21 +++++++--- .../arkui-ts/ts-drawing-components-polygon.md | 36 +++++++++++------ .../ts-drawing-components-polyline.md | 37 ++++++++++++------ .../arkui-ts/ts-drawing-components-rect.md | 39 +++++++++++-------- .../arkui-ts/ts-drawing-components-shape.md | 30 +++++++------- 9 files changed, 155 insertions(+), 90 deletions(-) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md index 34e32fe07d..724e55bdee 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md @@ -46,7 +46,7 @@ Gauge(options:{value: number, min?: number, max?: number}) | 名称 | 类型定义 | 描述 | | --------- | -------------------- | ------------------------------------------------------------ | -| ColorStop | [ResourceColor](../../ui/ts-types.md#resourcecolor8), number] | 描述渐进色颜色断点类型,第一个参数为颜色值,第二个参数为0~1之间的比例值。 | +| ColorStop | [[ResourceColor](../../ui/ts-types.md#resourcecolor8), number] | 描述渐进色颜色断点类型,第一个参数为颜色值,第二个参数为0~1之间的比例值。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md index 70d9312592..90493bc82e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-circle.md @@ -18,26 +18,32 @@ ## 接口 -Circle(options?: {width: Length, height: Length}) +Circle(options?: {width?: string | number, height?: string | number}) - 参数 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | options | Object | 否 | - | 见options参数说明。 | - -- options参数说明 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | width | Length | 是 | - | 宽度。 | - | height | Length | 是 | - | 高度。 | + | width | string \| number | 否 | 0 | 宽度。 | + | height | string \| number | 否 | 0 | 高度。 | ## 属性 +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| width | Length | 0 | 否 | 圆所在矩形的宽度。 | -| height | Length | 0 | 否 | 圆所在矩形的高度。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | Length | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md index 730cff1550..c60e34962e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-ellipse.md @@ -19,26 +19,32 @@ ## 接口 -ellipse(options?: {width: Length, height: Length}) +ellipse(options?: {width?: string | number, height?: string | number}) - 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | options | Object | 否 | - | 见options参数说明。 | - -- options参数说明 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | width | Length | 是 | - | 宽度。 | - | height | Length | 是 | - | 高度。 | + | width | string \| number | 否 | 0 | 宽度。 | + | height | string \| number | 否 | 0 | 高度。 | ## 属性 -| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + +| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| width | Length | 0 | 否 | 椭圆所在矩形的宽度。 | -| height | Length | 0 | 否 | 椭圆所在矩形的高度。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 |设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | Length | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md index ddb7da4114..fedc4b98f6 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md @@ -19,28 +19,34 @@ ## 接口 -Line(options?: {width: Length, height: Length}) +Line(options?: {width?: string | number, height?: string | number}) - 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | options | Object | 否 | - | 见options参数说明。 | - -- options参数说明 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | width | Length | 是 | - | 宽度。 | - | height | Length | 是 | - | 高度。 | + | width | string \| number | 否 | 0 | 宽度。 | + | height | string \| number | 否 | 0 | 高度。 | ## 属性 +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| width | [Length](../../ui/ts-types.md#length) | 0 | 否 | 直线所在矩形的宽度。 | -| height | [Length](../../ui/ts-types.md#length) | 0 | 否 | 直线所在矩形的高度。 | | startPoint | Array | [0, 0] | 是 | 直线起点坐标点(相对坐标)。 | | endPoint | Array | [0, 0] | 是 | 直线终点坐标点(相对坐标)。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | Length | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md index baf16cb7ff..f8f03398fb 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md @@ -23,9 +23,9 @@ Path(value?: { width?: number | string; height?: number | string; commands?: str | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | ---- | ------ | -------------------- | - | width | Length | 否 | 0 | 路径所在矩形的宽度 | - | height | Length | 否 | 0 | 路径所在矩形的高度 | - | commands | string | 是 | ‘ ’ | 路径绘制的命令字符串 | + | width | number \| string | 否 | 0 | 路径所在矩形的宽度 | + | height | number \| string | 否 | 0 | 路径所在矩形的高度 | + | commands | string | 否 | '' | 路径绘制的命令字符串 | @@ -35,9 +35,18 @@ Path(value?: { width?: number | string; height?: number | string; commands?: str | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | ----------------------------------- | ---- | ---- | ---------------------------------------- | -| width | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 路径所在矩形画布的宽度。 | -| height | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 路径所在矩形画布的高度。 | -| commands | string | '' | 是 | 路径绘制的命令字符串,单位为px。像素单位转换方法请参考[像素单位转换](../../ui/ts-pixel-units.md)。 | +| commands | string | '' | 否 | 路径绘制的命令字符串,单位为px。像素单位转换方法请参考[像素单位转换](../../ui/ts-pixel-units.md)。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | Length | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | commands支持的绘制命令如下: diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md index d521358731..365b8d7700 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md @@ -19,27 +19,41 @@ ## 接口 -Polygon(value:{options?: {width: Length, height: Length}}) +Polygon(options?: {width?: string | number, height?: string | number}) - 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | options | Object | 否 | - | 见options参数说明。 | - -- options参数说明 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | width | Length | 是 | - | 宽度。 | - | height | Length | 是 | - | 高度。 | + | width | string \| number | 否 | 0 | 宽度。 | + | height | string \| number | 否 | 0 | 高度。 | ## 属性 +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| width | Length | 0 | 否 | 多边形所在矩形的宽度。 | -| height | Length | 0 | 否 | 多边形所在矩形的高度。 | -| points | Array<Point> | - | 是 | 多边形的顶点坐标列表。 | +| points | Array<Point> | [] | 否 | 多边形的顶点坐标列表。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | Length | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | + +## Point + +点坐标类型。 + +| 名称 | 类型定义 | 描述 | +| --------- | -------------------- | ------------------------------------------------------------ | +| Point | [number, number] | 第一个参数为x轴坐标,第二个参数为y轴坐标(相对坐标)。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md index 6df605d888..cc23910962 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md @@ -19,28 +19,41 @@ ## 接口 -Polyline(options?: {width: Length, height: Length}) +Polyline(options?: {width?: string | number, height?: string | number}) - 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | options | Object | 否 | - | 见options参数说明。 | - -- options参数说明 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | width | Length | 是 | - | 宽度。 | - | height | Length | 是 | - | 高度。 | + | width | string \| number | 否 | 0 | 宽度。 | + | height | string \| number | 否 | 0 | 高度。 | ## 属性 +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| width | Length | 0 | 否 | 折线所在矩形的宽度。 | -| height | Length | 0 | 否 | 折线所在矩形的高度。 | -| points | Array<Point> | - | 是 | 折线经过坐标点列表。 | - +| points | Array<Point> | [] | 否 | 折线经过坐标点列表。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | Length | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | + +## Point + +点坐标类型。 + +| 名称 | 类型定义 | 描述 | +| --------- | -------------------- | ------------------------------------------------------------ | +| Point | [number, number] | 第一个参数为x轴坐标,第二个参数为y轴坐标(相对坐标)。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md index 31f0e858d4..1200e32be5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md @@ -19,32 +19,39 @@ ## 接口 -Rect(value:{options?: {width: Length,height: Length,radius?: Length | Array<Length>} | {width: Length,height: Length,radiusWidth?: Length,radiusHeight?: Length}}) +Rect(options?: {width?: string | number,height?: string | number,radius?: string | number | Array<string | number>} | + {width?: string | number,height?: string | number,radiusWidth?: string | number,radiusHeight?: string | number}) - 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | options | Object | 否 | - | 见options参数说明。 | - -- options参数说明 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | width | Length | 是 | - | 宽度。 | - | height | Length | 是 | - | 高度。 | - | radius | Length \| Array<Length> | 否 | 0 | 圆角半径,支持分别设置四个角的圆角度数。 | - | radiusWidth | Length | 否 | 0 | 圆角宽度。 | - | radiusHeight | Length | 否 | 0 | 圆角高度。 | + | width | string \| number | 否 | 0 | 宽度。 | + | height | string \| number | 否 | 0 | 高度。 | + | radius | string \| number \| Array<string \| number> | 否 | 0 | 圆角半径,支持分别设置四个角的圆角度数。 | + | radiusWidth | string \| number | 否 | 0 | 圆角宽度。 | + | radiusHeight | string \| number | 否 | 0 | 圆角高度。 | ## 属性 +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| width | Length | 0 | 否 | 宽度。 | -| height | Length | 0 | 否 | 高度。 | -| radiusWidth | Length | 0 | 否 | 圆角的宽度,仅设置宽时宽高一致。 | -| radiusHeight | Length | 0 | 否 | 圆角的高度,仅设置高时宽高一致。 | -| radius | Length \| Array<Length> | 0 | 否 | 圆角大小。 | +| radiusWidth | string \| number | 0 | 否 | 圆角的宽度,仅设置宽时宽高一致。 | +| radiusHeight | string \| number | 0 | 否 | 圆角的高度,仅设置高时宽高一致。 | +| radius | string \| number \| Array<string \| number> | 0 | 否 | 圆角半径大小。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | Length | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md index 026119a0ab..0dd21b3fd1 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md @@ -25,29 +25,33 @@ ## 接口 -Shape(value:{target?: PixelMap}) +Shape(value?: PixelMap) - 参数 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | target | PixelMap | 否 | null | 绘制目标,可将图形绘制在指定的PixelMap对象中,若未设置,则在当前绘制目标中进行绘制。 | + | value | PixelMap | 否 | - | 绘制目标,可将图形绘制在指定的PixelMap对象中,若未设置,则在当前绘制目标中进行绘制。 | ## 属性 +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| viewPort | {
x: Length,
y: Length,
width: Length,
height: Length
} | - | 是 | 形状的视口。 | -| fill | [ResourceColor](../../ui/ts-types.md) | Black | 否 | 填充颜色。 | -| stroke | [ResourceColor](../../ui/ts-types.md) | - | 否 | 边框颜色。 | -| strokeDashArray | Array<Length> | [] | 否 | 设置边框的间隙。 | -| strokeDashOffset | Length | 0 | 否 | 边框绘制起点的偏移量。 | -| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 路径端点绘制样式。 | -| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 边框拐角绘制样式。 | -| strokeMiterLimit | number \| string | 4 | 否 | 锐角绘制成斜角的极限值。 | -| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置边框的不透明度。 | -| strokeWidth | Length | 1 | 否 | 设置边框的宽度。 | -| antiAlias | boolean | true | 否 | 是否开启抗锯齿。 | +| viewPort | {
x?: number \| string,
y?: number \| string,
width?: number \| string,
height?: number \| string
} | { x:0, y:0, width:0, height:0 } | 否 | 形状的视口。 | +| fill | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](../../ui/ts-types.md) | Color.Black | 否 | 设置线条颜色。 | +| strokeDashArray | Array<Length> | [] | 否 | 设置线条间隙。 | +| strokeDashOffset | number \| string | 0 | 否 | 线条绘制起点的偏移量。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 设置线条端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 设置线条拐角绘制样式。 | +| strokeMiterLimit | number \| string | 4 | 否 | 设置锐角绘制成斜角的极限值。 | +| strokeOpacity | number \| string \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | +| strokeWidth | number \| string | 1 | 否 | 设置线条宽度。 | +| antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | +| mesh8+ | Array<number>,number,number | [],0,0 | 否 | 设置mesh效果。第一个参数为长度(column + 1)* (row + 1)* 2的数组,它记录了扭曲后的位图各个顶点位置,第二个参数为mesh矩阵列数column,第三个参数为mesh矩阵行数row。 | ## 示例 -- GitLab