diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md b/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md index f94a20bf5991f7dc4c8066278d687ee022540103..639d952b396a54ea009ec293b03053db53ea904f 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md @@ -47,25 +47,25 @@ ## 属性 -| 名称 | 类型 | 默认值 | 描述 | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| [fillStyle](#fillstyle) | <color> \| [CanvasGradient](../arkui-js/js-components-canvas-canvasgradient.md) \| CanvasPattern | - | 指定绘制的填充色。
- 类型为<color>时,表示设置填充区域的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用 createLinearGradient()方法创建。
- 类型为CanvasPattern时,使用 createPattern()方法创建。 | -| [lineWidth](#linewidth) | number | - | 设置绘制线条的宽度。 | -| [strokeStyle](#strokestyle) | <color> \| [CanvasGradient](../arkui-js/js-components-canvas-canvasgradient.md) \| CanvasPattern | - | 设置描边的颜色。
- 类型为<color>时,表示设置描边使用的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用 createLinearGradient()方法创建。
- 类型为CanvasPattern时,使用 createPattern()方法创建。 | -| [lineCap](#linecap) | string | butt | 指定线端点的样式,可选值为:
- butt:线端点以方形结束。
- round:线端点以圆形结束。
- square:线端点以方形结束,该样式下会增加一个长度和线段厚度相同,宽度是线段厚度一半的矩形。 | -| [lineJoin](#linejoin) | string | miter | 指定线段间相交的交点样式,可选值为:
- round:在线段相连处绘制一个扇形,扇形的圆角半径是线段的宽度。
- bevel:在线段相连处使用三角形为底填充, 每个部分矩形拐角独立。
- miter:在相连部分的外边缘处进行延伸,使其相交于一点,形成一个菱形区域,该属性可以通过设置miterLimit属性展现效果。 | -| [miterLimit](#miterlimit) | number | 10 | 设置斜接面限制值,该值指定了线条相交处内角和外角的距离。 | -| [font](#font) | string | "normal normal 14px sans-serif" | 设置文本绘制中的字体样式。
语法:ctx.font="font-style font-weight font-size font-family"5+
- font-style(可选),用于指定字体样式,支持如下几种样式:normal, italic。
- font-weight(可选),用于指定字体的粗细,支持如下几种类型:normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900。
- font-size(可选),指定字号和行高,单位只支持px。
- font-family(可选),指定字体系列,支持如下几种类型:sans-serif, serif, monospace。 | -| [textAlign](#textalign) | string | left | 设置文本绘制中的文本对齐方式,可选值为:
- left:文本左对齐。
- right:文本右对齐。
- center:文本居中对齐。
- start:文本对齐界线开始的地方。
- end:文本对齐界线结束的地方。
ltr布局模式下start和left一致,rtl布局模式下start和right一致·。 | -| [textBaseline](#textbaseline) | string | alphabetic | 设置文本绘制中的水平对齐方式,可选值为:
- alphabetic:文本基线是标准的字母基线。
- top:文本基线在文本块的顶部。
- hanging:文本基线是悬挂基线。
- middle:文本基线在文本块的中间。
- ideographic:文字基线是表意字基线;如果字符本身超出了alphabetic 基线,那么ideographic基线位置在字符本身的底部。
- bottom:文本基线在文本块的底部。 与 ideographic 基线的区别在于 ideographic 基线不需要考虑下行字母。 | -| [globalAlpha](#globalalpha) | number | - | 设置透明度,0.0为完全透明,1.0为完全不透明。 | -| [lineDashOffset](#linedashoffset) | number | 0.0 | 设置画布的虚线偏移量,精度为float。 | -| [globalCompositeOperation](#globalcompositeoperation) | string | source-over | 设置合成操作的方式。类型字段可选值有source-over,source-atop,source-in,source-out,destination-over,destination-atop,destination-in,destination-out,lighter,copy,xor。具体请参考[表 类型字段说明](#globalcompositeoperation)。 | -| [shadowBlur](#shadowblur) | number | 0.0 | 设置绘制阴影时的模糊级别,值越大越模糊,精度为float。 | -| [shadowColor](#shadowcolor) | <color> | - | 设置绘制阴影时的阴影颜色。 | -| [shadowOffsetX](#shadowoffsetx) | number | - | 设置绘制阴影时和原有对象的水平偏移值。 | -| [shadowOffsetY](#shadowoffsety) | number | - | 设置绘制阴影时和原有对象的垂直偏移值。 | -| [imageSmoothingEnabled](#imagesmoothingenabled6)6+ | boolean | true | 用于设置绘制图片时是否进行图像平滑度调整,true为启用,false为不启用。 | +| 名称 | 类型 | 描述 | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| [fillStyle](#fillstyle) | <color> \| [CanvasGradient](../arkui-js/js-components-canvas-canvasgradient.md) \| CanvasPattern | 指定绘制的填充色。
- 类型为<color>时,表示设置填充区域的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用 createLinearGradient()方法创建。
- 类型为CanvasPattern时,使用 createPattern()方法创建。 | +| [lineWidth](#linewidth) | number | 设置绘制线条的宽度。 | +| [strokeStyle](#strokestyle) | <color> \| [CanvasGradient](../arkui-js/js-components-canvas-canvasgradient.md) \| CanvasPattern | 设置描边的颜色。
- 类型为<color>时,表示设置描边使用的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用 createLinearGradient()方法创建。
- 类型为CanvasPattern时,使用 createPattern()方法创建。 | +| [lineCap](#linecap) | string | 指定线端点的样式,可选值为:
- butt:线端点以方形结束。
- round:线端点以圆形结束。
- square:线端点以方形结束,该样式下会增加一个长度和线段厚度相同,宽度是线段厚度一半的矩形。
默认值:butt | +| [lineJoin](#linejoin) | string | 指定线段间相交的交点样式,可选值为:
- round:在线段相连处绘制一个扇形,扇形的圆角半径是线段的宽度。
- bevel:在线段相连处使用三角形为底填充, 每个部分矩形拐角独立。
- miter:在相连部分的外边缘处进行延伸,使其相交于一点,形成一个菱形区域,该属性可以通过设置miterLimit属性展现效果。
默认值:miter | +| [miterLimit](#miterlimit) | number | 设置斜接面限制值,该值指定了线条相交处内角和外角的距离。
默认值:10 | +| [font](#font) | string | 设置文本绘制中的字体样式。
语法:ctx.font="font-style font-weight font-size font-family"5+
- font-style(可选),用于指定字体样式,支持如下几种样式:normal, italic。
- font-weight(可选),用于指定字体的粗细,支持如下几种类型:normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900。
- font-size(可选),指定字号和行高,单位只支持px。
- font-family(可选),指定字体系列,支持如下几种类型:sans-serif, serif, monospace。
默认值:"normal normal 14px sans-serif" | +| [textAlign](#textalign) | string | 设置文本绘制中的文本对齐方式,可选值为:
- left:文本左对齐。
- right:文本右对齐。
- center:文本居中对齐。
- start:文本对齐界线开始的地方。
- end:文本对齐界线结束的地方。
ltr布局模式下start和left一致,rtl布局模式下start和right一致。
默认值:left | +| [textBaseline](#textbaseline) | string | 设置文本绘制中的水平对齐方式,可选值为:
- alphabetic:文本基线是标准的字母基线。
- top:文本基线在文本块的顶部。
- hanging:文本基线是悬挂基线。
- middle:文本基线在文本块的中间。
- ideographic:文字基线是表意字基线;如果字符本身超出了alphabetic 基线,那么ideographic基线位置在字符本身的底部。
- bottom:文本基线在文本块的底部。 与 ideographic 基线的区别在于 ideographic 基线不需要考虑下行字母。
默认值: alphabetic | +| [globalAlpha](#globalalpha) | number | 设置透明度,0.0为完全透明,1.0为完全不透明。 | +| [lineDashOffset](#linedashoffset) | number | 设置画布的虚线偏移量,精度为float。
默认值:0.0 | +| [globalCompositeOperation](#globalcompositeoperation) | string | 设置合成操作的方式。类型字段可选值有source-over,source-atop,source-in,source-out,destination-over,destination-atop,destination-in,destination-out,lighter,copy,xor。具体请参考[表 类型字段说明](#globalcompositeoperation)。
默认值:ource-over | +| [shadowBlur](#shadowblur) | number | 设置绘制阴影时的模糊级别,值越大越模糊,精度为float。
默认值:0.0 | +| [shadowColor](#shadowcolor) | <color> | 设置绘制阴影时的阴影颜色。 | +| [shadowOffsetX](#shadowoffsetx) | number | 设置绘制阴影时和原有对象的水平偏移值。 | +| [shadowOffsetY](#shadowoffsety) | number | 设置绘制阴影时和原有对象的垂直偏移值。 | +| [imageSmoothingEnabled](#imagesmoothingenabled6)6+ | boolean | 用于设置绘制图片时是否进行图像平滑度调整,true为启用,false为不启用。
默认值:true | ### fillStyle diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-common-animation.md b/zh-cn/application-dev/reference/arkui-js/js-components-common-animation.md index d0b3d57916df702b6229c17a072e2f37fb991d9f..b7c71d2d19e6132320224368e41cc6c975ebf7ed 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-common-animation.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-common-animation.md @@ -7,20 +7,20 @@ 组件支持动态的旋转、平移、缩放效果,可在style或css中设置。 -| 名称 | 类型 | 默认值 | 描述 | -| --------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| transform-origin | string6+ \| <percentage> \| <length> string6+ \| <percentage> \| <length> | center center | 变换对象的原点位置,支持px和百分比(相对于动画目标组件),如果仅设置一个值,另一个值为50%,第一个string的可选值为:left \| center \| right ,第二个string的可选值为:top \| center \| bottom。
示例:
transform-origin: 200px 30%。
transform-origin: 100px top。
transform-origin: center center。 | -| transform | string | - | 支持同时设置平移/旋转/缩放的属性。
详见表 transform操作说明。 | -| animation6+ | string | 0s ease 0s 1 normal none running none | 格式:duration \| timing-function \| delay \| iteration-count \| direction \| fill-mode \| play-state \| name,每个字段不区分先后,但是 duration / delay 按照出现的先后顺序解析。 | -| animation-name | string | - | 指定\@keyframes,详见表 @keyframes属性说明。 | -| animation-delay | <time> | 0 | 定义动画播放的延迟时间。支持的单位为[s(秒)\|ms(毫秒) ],默认单位为ms,格式为:1000ms或1s。 | -| animation-duration | <time> | 0 | 定义一个动画周期。支持的单位为[s(秒)\|ms(毫秒) ],默认单位为ms,格式为:1000ms或1s。
必须设置animation-duration 样式,否则时长为 0将不会播放动画。 | -| animation-iteration-count | number \| infinite | 1 | 定义动画播放的次数,默认播放一次,可通过设置为infinite无限次播放。 | -| animation-timing-function | string | ease
| 描述动画执行的速度曲线,用于使动画更为平滑。
可选项有:
- linear:表示动画从头到尾的速度都是相同的。
- ease:表示动画以低速开始,然后加快,在结束前变慢,cubic-bezier(0.25, 0.1, 0.25, 1.0)。
- ease-in:表示动画以低速开始,cubic-bezier(0.42, 0.0, 1.0, 1.0)。
- ease-out:表示动画以低速结束,cubic-bezier(0.0, 0.0, 0.58, 1.0)。
- ease-in-out:表示动画以低速开始和结束,cubic-bezier(0.42, 0.0, 0.58, 1.0)。
- friction:阻尼曲线,cubic-bezier(0.2, 0.0, 0.2, 1.0)。
- extreme-deceleration:急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。
- sharp:锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。
- rhythm:节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。
- smooth:平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。
- cubic-bezier:在三次贝塞尔函数中定义动画变化过程,入参的x和y值必须处于0-1之间。
- steps: 阶梯曲线6+。语法:steps(number[, end\|start]);number必须设置,支持的类型为正整数。第二个参数可选,表示在每个间隔的起点或是终点发生阶跃变化,支持设置end或start,默认值为end。 | -| animation-direction6+ | string | normal | 指定动画的播放模式:
- normal: 动画正向循环播放。
- reverse: 动画反向循环播放。
- alternate:动画交替循环播放,奇数次正向播放,偶数次反向播放。
- alternate-reverse:动画反向交替循环播放,奇数次反向播放,偶数次正向播放。 | -| animation-fill-mode | string | none | 指定动画开始和结束的状态:
- none:在动画执行之前和之后都不会应用任何样式到目标上。
- forwards:在动画结束后,目标将保留动画结束时的状态(在最后一个关键帧中定义)。
- backwards6+:动画将在animation-delay期间应用第一个关键帧中定义的值。当animation-direction为"normal"或"alternate"时应用from关键帧中的值,当animation-direction为"reverse"或"alternate-reverse"时应用to关键帧中的值。
- both6+:动画将遵循forwards和backwards的规则,从而在两个方向上扩展动画属性。 | -| animation-play-state6+ | string | running | 指定动画的当前状态:
- paused:动画状态为暂停。
- running:动画状态为播放。 | -| transition6+ | string | all 0 ease 0 | 指定组件状态切换时的过渡效果,可以通过transition属性设置如下四个属性:
- transition-property:规定设置过渡效果的 CSS 属性的名称,目前支持宽、高、背景色。
- transition-duration:规定完成过渡效果需要的时间,单位秒。
- transition-timing-function:规定过渡效果的时间曲线,支持样式动画提供的曲线。
- transition-delay:规定过渡效果延时启动时间,单位秒。 | +| 名称 | 类型 | 描述 | +| --------------------------------- | ---------------------------------------- | ---------------------------------------- | +| transform-origin | string6+ \|
 <percentage> \|
 <length> string6+ \|
 <percentage> \| <length> | 变换对象的原点位置,支持px和百分比(相对于动画目标组件),如果仅设置一个值,另一个值为50%,第一个string的可选值为:left \| center \| right ,第二个string的可选值为:top \| center \| bottom。
示例:
transform-origin: 200px 30%。
transform-origin: 100px top。
transform-origin: center center。
默认值:center center | +| transform | string | 支持同时设置平移/旋转/缩放的属性。
详见表 transform操作说明。 | +| animation6+ | string | 格式:duration \| timing-function \| delay \| iteration-count \| direction \| fill-mode \| play-state \| name,每个字段不区分先后,但是 duration / delay 按照出现的先后顺序解析。
默认值:0s ease 0s 1 normal none running none | +| animation-name | string | 指定\@keyframes,详见表 @keyframes属性说明。 | +| animation-delay | <time> | 定义动画播放的延迟时间。支持的单位为[s(秒)\|ms(毫秒) ],默认单位为ms,格式为:1000ms或1s。
默认值:0 | +| animation-duration | <time> | 定义一个动画周期。支持的单位为[s(秒)\|ms(毫秒) ],默认单位为ms,格式为:1000ms或1s。
必须设置animation-duration 样式,否则时长为 0将不会播放动画。
默认值:0 | +| animation-iteration-count | number \| infinite | 定义动画播放的次数,默认播放一次,可通过设置为infinite无限次播放。
默认值:1 | +| animation-timing-function | string | 描述动画执行的速度曲线,用于使动画更为平滑。
可选项有:
- linear:表示动画从头到尾的速度都是相同的。
- ease:表示动画以低速开始,然后加快,在结束前变慢,cubic-bezier(0.25, 0.1, 0.25, 1.0)。
- ease-in:表示动画以低速开始,cubic-bezier(0.42, 0.0, 1.0, 1.0)。
- ease-out:表示动画以低速结束,cubic-bezier(0.0, 0.0, 0.58, 1.0)。
- ease-in-out:表示动画以低速开始和结束,cubic-bezier(0.42, 0.0, 0.58, 1.0)。
- friction:阻尼曲线,cubic-bezier(0.2, 0.0, 0.2, 1.0)。
- extreme-deceleration:急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。
- sharp:锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。
- rhythm:节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。
- smooth:平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。
- cubic-bezier:在三次贝塞尔函数中定义动画变化过程,入参的x和y值必须处于0-1之间。
- steps: 阶梯曲线6+。语法:steps(number[, end\|start]);number必须设置,支持的类型为正整数。第二个参数可选,表示在每个间隔的起点或是终点发生阶跃变化,支持设置end或start,默认值为end。
默认值:ease | +| animation-direction6+ | string | 指定动画的播放模式:
- normal: 动画正向循环播放。
- reverse: 动画反向循环播放。
- alternate:动画交替循环播放,奇数次正向播放,偶数次反向播放。
- alternate-reverse:动画反向交替循环播放,奇数次反向播放,偶数次正向播放。
默认值:normal | +| animation-fill-mode | string | 指定动画开始和结束的状态:
- none:在动画执行之前和之后都不会应用任何样式到目标上。
- forwards:在动画结束后,目标将保留动画结束时的状态(在最后一个关键帧中定义)。
- backwards6+:动画将在animation-delay期间应用第一个关键帧中定义的值。当animation-direction为"normal"或"alternate"时应用from关键帧中的值,当animation-direction为"reverse"或"alternate-reverse"时应用to关键帧中的值。
- both6+:动画将遵循forwards和backwards的规则,从而在两个方向上扩展动画属性。
默认值:none | +| animation-play-state6+ | string | 指定动画的当前状态:
- paused:动画状态为暂停。
- running:动画状态为播放。
默认值:running | +| transition6+ | string | 指定组件状态切换时的过渡效果,可以通过transition属性设置如下四个属性:
- transition-property:规定设置过渡效果的 CSS 属性的名称,目前支持宽、高、背景色。
- transition-duration:规定完成过渡效果需要的时间,单位秒。
- transition-timing-function:规定过渡效果的时间曲线,支持样式动画提供的曲线。
- transition-delay:规定过渡效果延时启动时间,单位秒。
默认值:all 0 ease 0 | **表1** transform操作说明 @@ -30,11 +30,11 @@ | none6+ | - | 不进行任何转换。 | | matrix6+ | <number> | 入参为六个值的矩阵,6个值分别代表:scaleX, skewY, skewX, scaleY, translateX, translateY。 | | matrix3d6+ | <number> | 入参为十六个值的4X4矩阵。 | -| translate | <length> \| <percent> | 平移动画属性,支持设置x轴和y轴两个维度的平移参数。 | -| translate3d6+ | <length> \| <percent> | 三个入参,分别代表X轴、Y轴、Z轴的平移距离。 | -| translateX | <length> \| <percent> | X轴方向平移动画属性。 | -| translateY | <length> \| <percent> | Y轴方向平移动画属性。 | -| translateZ6+ | <length> \| <percent> | Z轴的平移距离。 | +| translate | <length> \| <percent> | 平移动画属性,支持设置x轴和y轴两个维度的平移参数。 | +| translate3d6+ | <length> \| <percent> | 三个入参,分别代表X轴、Y轴、Z轴的平移距离。 | +| translateX | <length> \| <percent> | X轴方向平移动画属性。 | +| translateY | <length> \| <percent> | Y轴方向平移动画属性。 | +| translateZ6+ | <length> \| <percent> | Z轴的平移距离。 | | scale | <number> | 缩放动画属性,支持设置x轴和y轴两个维度的缩放参数。 | | scale3d6+ | <number> | 三个入参,分别代表X轴、Y轴、Z轴的缩放参数。 | | scaleX | <number> | X轴方向缩放动画属性。 | @@ -59,7 +59,7 @@ | width | <length> | - | 动画执行后应用到组件上的宽度值。 | | height | <length> | - | 动画执行后应用到组件上的高度值。 | | transform | string | - | 定义应用在组件上的变换类型,见表 transform操作说明。 | -| background-position6+ | string \| <percentage> \| <length> string \| <percentage> \| <length> | 50% 50% | 背景图位置。单位支持百分比和px,第一个值是水平位置,第二个值是垂直位置。如果仅设置一个值,另一个值为50%。第一个string的可选值为:left \| center \| right ,第二个string的可选值为:top \| center \| bottom。
示例:
- background-position: 200px 30%
- background-position: 100px top
- background-position: center center | +| background-position6+ | string \| <percentage> \| <length> string \|
 <percentage> \| <length> | 50% 50% | 背景图位置。单位支持百分比和px,第一个值是水平位置,第二个值是垂直位置。如果仅设置一个值,另一个值为50%。第一个string的可选值为:left \| center \| right ,第二个string的可选值为:top \| center \| bottom。
示例:
- background-position: 200px 30%
- background-position: 100px top
- background-position: center center | 对于不支持起始值或终止值缺省的情况,可以通过from和to显示指定起始和结束。可以通过百分比指定动画运行的中间状态6+。示例: diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper.md b/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper.md index b665bb83e62f1bda1ae1a3369b0ef7d9e94f9f3a..817e33cf5f0ae34156f8546e1ffc7ec52c04a399 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper.md @@ -45,8 +45,8 @@ | finish | 无 | 当步骤导航器最后一个步骤完成时触发该事件。 | | skip | 无 | 当通过setNextButtonStatus方法设置当前步骤导航器可跳过时,点击右侧跳过按钮触发该事件。 | | change | { prevIndex:prevIndex, index: index} | 当步骤导航器点击左边或者右边文本按钮进行步骤切换时触发该事件,prevIndex表示老步骤的序号,index表示新步骤的序号。 | -| next | { index:index, pendingIndex: pendingIndex } | 当用户点击下一步按钮时触发该事件,index表示当前步骤序号,pendingIndex表示将于跳转的序号,该事件有返回值,返回值格式为:{ pendingIndex:pendingIndex },可以通过指定pendingIndex来修改下一个步骤使用哪个stepper-item子组件。 | -| back | { index:index, pendingIndex: pendingIndex } | 当用户点击上一步按钮时触发该事件,index表示当前步骤序号,pendingIndex表示将于跳转的序号,该事件有返回值,返回值格式为Object:{ pendingIndex:pendingIndex },可以通过指定pendingIndex来修改上一个步骤使用哪个stepper-item子组件。 | +| next | { index:index, pendingIndex: pendingIndex } | 当用户点击下一步按钮时触发该事件,index表示当前步骤序号,pendingIndex表示将要跳转的序号,该事件有返回值,返回值格式为:{ pendingIndex:pendingIndex },可以通过指定pendingIndex来修改下一个步骤使用哪个stepper-item子组件。 | +| back | { index:index, pendingIndex: pendingIndex } | 当用户点击上一步按钮时触发该事件,index表示当前步骤序号,pendingIndex表示将要跳转的序号,该事件有返回值,返回值格式为Object:{ pendingIndex:pendingIndex },可以通过指定pendingIndex来修改上一个步骤使用哪个stepper-item子组件。 | ## 方法 diff --git a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md index 5eb5a49955b47df7d72293fc49453e17775ab632..12c658c75628e84883cdecf837d2a290a79d4d20 100644 --- a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md +++ b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md @@ -159,4 +159,5 @@ - [时间选择弹窗](ts-methods-timepicker-dialog.md) - [文本选择弹窗](ts-methods-textpicker-dialog.md) - [菜单](ts-methods-menu.md) -- [文档中涉及到的内置枚举值](ts-appendix-enums.md) +- [枚举说明](ts-appendix-enums.md) +- [类型说明](ts-types.md) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md index badc57b479c59ac82b35e9261e779213b905b530..6a7dcbaac67bf9a854829a86f02062de6dd929ec 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-blank.md @@ -28,7 +28,7 @@ Blank(min?: number | string) | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| color | [ResourceColor](../../ui/ts-types.md) | 设置空白填充的填充颜色。 | +| color | [ResourceColor](ts-types.md) | 设置空白填充的填充颜色。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-button.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-button.md index 68ebd224a1dc3347fc4c098c4139be0836e820fe..5b16c09ec99f6f311f830af1f7ecb59c68d9c2c9 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-button.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-button.md @@ -36,7 +36,7 @@ | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | ------- | ----------------------------------- | ---- | ---- | ------------- | - | label | [ResourceStr](../../ui/ts-types.md) | 否 | - | 按钮文本内容。 | + | label | [ResourceStr](ts-types.md) | 否 | - | 按钮文本内容。 | | options | Object | 否 | - | 见options参数说明。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md index b16f9057e8ea6513b64cdf3ade64563dba03216b..1885dab05ed103598e3c30f82e8e6543061ac339 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md @@ -29,7 +29,7 @@ Checkbox( option?: {name?: string, group?: string }) | 名称 | 参数类型 | 描述 | | ------------- | ------- | -------- | | select | boolean | 设置多选框是否选中。
默认值:false | -| selectedColor | [ResourceColor](../../ui/ts-types.md) | 设置多选框选中状态颜色。 | +| selectedColor | [ResourceColor](ts-types.md) | 设置多选框选中状态颜色。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md index 2645b7bc25d0c920c27b7f69b051763640892b2a..2a43aa72f4f1466edae2e7c349f76fb9df815d12 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md @@ -31,7 +31,7 @@ CheckboxGroup( group?: string ) | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | | selectAll | boolean | 设置是否全选。
默认值:false | -| selectedColor | [ResourceColor](../../ui/ts-types.md) | 设置被选中或部分选中状态的颜色。 | +| selectedColor | [ResourceColor](ts-types.md) | 设置被选中或部分选中状态的颜色。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md index 51a10ae1059e5c0912a6aaf10b90299aeddb49a3..53ad72fc1f7253302d29ccef2bab74476ed92501 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-divider.md @@ -23,7 +23,7 @@ Divider() | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | | vertical | boolean | 使用水平分割线还是垂直分割线。false:水平分割线;true:垂直分割线。
默认值:false | -| color | [ResourceColor](../../ui/ts-types.md) | 分割线颜色。 | +| color | [ResourceColor](ts-types.md) | 分割线颜色。 | | strokeWidth | number \| string | 分割线宽度。
默认值:1 | | lineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | 分割线的端点样式。
默认值:LineCapStyle.Butt | 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 6a6311e3c54bde20e87acceccce6bde6236c59f3..3bcc593769d261fe4f55595829239fbb91fdc512 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 @@ -43,7 +43,7 @@ Gauge(options:{value: number, min?: number, max?: number}) | 名称 | 类型定义 | 描述 | | --------- | -------------------- | ------------------------------------------------------------ | -| ColorStop | [[ResourceColor](../../ui/ts-types.md#resourcecolor8), number] | 描述渐进色颜色断点类型,第一个参数为颜色值,第二个参数为0~1之间的比例值。 | +| ColorStop | [[ResourceColor](ts-types.md#resourcecolor8), number] | 描述渐进色颜色断点类型,第一个参数为颜色值,第二个参数为0~1之间的比例值。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md index 630e8164c1bd7ab796bafcfc8d01e7b9306261a6..76ed9ceb424cd77b08f7118d0359794b04db62ee 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md @@ -27,7 +27,7 @@ Image(src: string | PixelMap | Resource) | 参数名 | 参数类型 | 必填 | 参数描述 | | ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| src | string\| [PixelMap](../apis/js-apis-image.md#pixelmap7) \| [Resource](../../ui/ts-types.md#resource类型) | 是 | 图片的数据源,支持本地图片和网络图片。
当使用相对路径引用图片资源时,例如`Image("common/test.jpg")`,不支持跨包/跨模块调用该Image组件,建议使用`$r`方式来管理需全局使用的图片资源。
\- 支持的图片格式包括png、jpg、bmp、svg和gif。
\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]`为`Base64`字符串数据。
\- 支持`dataability://`路径前缀的字符串,用于访问通过data ability提供的图片路径。 | +| src | string\| [PixelMap](../apis/js-apis-image.md#pixelmap7) \| [Resource](ts-types.md#resource类型) | 是 | 图片的数据源,支持本地图片和网络图片。
当使用相对路径引用图片资源时,例如`Image("common/test.jpg")`,不支持跨包/跨模块调用该Image组件,建议使用`$r`方式来管理需全局使用的图片资源。
\- 支持的图片格式包括png、jpg、bmp、svg和gif。
\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]`为`Base64`字符串数据。
\- 支持`dataability://`路径前缀的字符串,用于访问通过data ability提供的图片路径。 | ## 属性 @@ -35,7 +35,7 @@ Image(src: string | PixelMap | Resource) | 名称 | 参数类型 | 描述 | | --------------------- | ------------------------------------------------------- | ------------------------------------------------------------ | -| alt | string \| [Resource](../../ui/ts-types.md#resource类型) | 加载时显示的占位图,支持本地图片和网络图片。 | +| alt | string \| [Resource](ts-types.md#resource类型) | 加载时显示的占位图,支持本地图片和网络图片。 | | objectFit | [ImageFit](ts-appendix-enums.md#imagefit) | 设置图片的缩放类型。
默认值:ImageFit.Cover | | objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat) | 设置图片的重复样式。
默认值:NoRepeat
**说明:**
svg类型图源不支持该属性。 | | interpolation | [ImageInterpolation](#imageinterpolation) | 设置图片的插值效果,即减轻低清晰度图片在放大显示的时候出现的锯齿问题,仅针对图片放大插值。
默认值:ImageInterpolation.None
**说明:**
svg类型图源不支持该属性。
PixelMap资源不支持该属性。 | @@ -43,11 +43,11 @@ Image(src: string | PixelMap | Resource) | sourceSize | {
width: number,
height: number
} | 设置图片裁剪尺寸,将原始图片解码成pixelMap,指定尺寸的图片,单位为px。
**说明:**
PixelMap资源不支持该属性。 | | matchTextDirection | boolean | 设置图片是否跟随系统语言方向,在RTL语言环境下显示镜像翻转显示效果。
默认值:false | | fitOriginalSize | boolean | 图片组件尺寸未设置时,其显示尺寸是否跟随图源尺寸。
默认值:true | -| fillColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 填充颜色。设置的填充颜色会覆盖在图片上。仅对svg图源生效,设置后会替换svg图片的fill颜色。 | +| fillColor | [ResourceColor](ts-types.md#resourcecolor8) | 填充颜色。设置的填充颜色会覆盖在图片上。仅对svg图源生效,设置后会替换svg图片的fill颜色。 | | autoResize | boolean | 是否需要在图片解码过程中对图源做resize操作,该操作会根据显示区域的尺寸决定用于绘制的图源尺寸,有利于减少内存占用。
默认值:true | | syncLoad8+ | boolean | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。
默认值:false | | copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置图片是否可复制(SVG图片不支持复制)。
当copyOption设置为非CopyOptions.None时,支持使用长按、鼠标右击、快捷组合键'CTRL+C'等方式进行复制。
默认值:CopyOptions.None | -| colorFilter9+ | [ColorFilter](../../ui/ts-types.md#colorfilter9) | 给图像设置颜色滤镜效果。 | +| colorFilter9+ | [ColorFilter](ts-types.md#colorfilter9) | 给图像设置颜色滤镜效果。 | > **说明:** > diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md index e24457c1753d5b4381941387adda9fc10f10a866..97635bb4f1871858501418826e24633ee7376411 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md @@ -38,11 +38,11 @@ ImageAnimator() - ImageFrameInfo属性说明 | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | src | string \| [Resource](../../ui/ts-types.md#resource类型)9+ | "" | 是 | 图片路径,图片格式为svg,png和jpg,从API Version9开始支持[Resource](../../ui/ts-types.md#resource类型)类型的路径 | - | width | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 图片宽度 | - | height | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 图片高度 | - | top | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 图片相对于组件左上角的纵向坐标 | - | left | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 图片相对于组件左上角的横向坐标 | + | src | string \| [Resource](ts-types.md#resource类型)9+ | "" | 是 | 图片路径,图片格式为svg,png和jpg,从API Version9开始支持[Resource](ts-types.md#resource类型)类型的路径 | + | width | [Length](ts-types.md#长度类型) | 0 | 否 | 图片宽度 | + | height | [Length](ts-types.md#长度类型) | 0 | 否 | 图片高度 | + | top | [Length](ts-types.md#长度类型) | 0 | 否 | 图片相对于组件左上角的纵向坐标 | + | left | [Length](ts-types.md#长度类型) | 0 | 否 | 图片相对于组件左上角的横向坐标 | | duration | number | 0 | 否 | 每一帧图片的播放时长,单位毫秒 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-loadingprogress.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-loadingprogress.md index db994a3d8e0f9316526ecde92224dd91e62b5226..506ff40553df13f2a9d58ba40a4df7763574b61e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-loadingprogress.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-loadingprogress.md @@ -21,7 +21,7 @@ LoadingProgress() | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| color | [ResourceColor](../../ui/ts-types.md) | 设置加载进度条前景色。 | +| color | [ResourceColor](ts-types.md) | 设置加载进度条前景色。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md index c2804ee0d0a49aff0cf6f331d1b05f5fda9c139f..78a7eb4ceb78f46a50b31e1fbe9d4125d59525e9 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md @@ -24,11 +24,11 @@ Navigation() | 名称 | 参数类型 | 描述 | | -------------- | ---------------------------------------- | ---------------------------------------- | -| title | string \| [CustomBuilder](../../ui/ts-types.md) | 页面标题。 | +| title | string \| [CustomBuilder](ts-types.md) | 页面标题。 | | subTitle | string | 页面副标题。 | -| menus | Array8+ | 页面右上角菜单。 | +| menus | Array8+ | 页面右上角菜单。 | | titleMode | NavigationTitleMode | 页面标题栏显示模式。
默认值:NavigationTitleMode.Free | -| toolBar | object \| [CustomBuilder](../../ui/ts-types.md#custombuilder8)8+ | 设置工具栏内容。
items: 工具栏所有项。 | +| toolBar | object \| [CustomBuilder](ts-types.md#custombuilder8)8+ | 设置工具栏内容。
items: 工具栏所有项。 | | hideToolBar | boolean | 设置隐藏/显示工具栏:
默认值:false
true: 隐藏工具栏。
false: 显示工具栏。 | | hideTitleBar | boolean | 隐藏标题栏。
默认值:false | | hideBackButton | boolean | 隐藏返回键。
默认值:false | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-patternlock.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-patternlock.md index 95099d70d17963958d6d4dd65c2505cc34bde389..27ba28ae074f78a265e1fec5d95fdcd47413d3b0 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-patternlock.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-patternlock.md @@ -26,12 +26,12 @@ PatternLock(controller?: PatternLockController) | 名称 | 参数类型 | 描述 | | --------------- | ------------------------------------- | ------------------------------------------------------------ | -| sideLength | [Length](../../ui/ts-types.md) | 设置组件的宽度和高度(相同值)。最小可以设置为0。
默认值:300vp | -| circleRadius | [Length](../../ui/ts-types.md) | 设置宫格圆点的半径。
默认值:14vp | -| regularColor | [ResourceColor](../../ui/ts-types.md) | 设置宫格圆点在“未选中”状态的填充颜色。
默认值:Color.Black | -| selectedColor | [ResourceColor](../../ui/ts-types.md) | 设置宫格圆点在“选中”状态的填充颜色。
默认值:Color.Black | -| activeColor | [ResourceColor](../../ui/ts-types.md) | 设置宫格圆点在“激活”状态的填充颜色。
默认值:Color.Black | -| pathColor | [ResourceColor](../../ui/ts-types.md) | 设置连线的颜色。
默认值:Color.Blue | +| sideLength | [Length](ts-types.md) | 设置组件的宽度和高度(相同值)。最小可以设置为0。
默认值:300vp | +| circleRadius | [Length](ts-types.md) | 设置宫格圆点的半径。
默认值:14vp | +| regularColor | [ResourceColor](ts-types.md) | 设置宫格圆点在“未选中”状态的填充颜色。
默认值:Color.Black | +| selectedColor | [ResourceColor](ts-types.md) | 设置宫格圆点在“选中”状态的填充颜色。
默认值:Color.Black | +| activeColor | [ResourceColor](ts-types.md) | 设置宫格圆点在“激活”状态的填充颜色。
默认值:Color.Black | +| pathColor | [ResourceColor](ts-types.md) | 设置连线的颜色。
默认值:Color.Blue | | pathStrokeWidth | number \| string | 设置连线的宽度。最小可以设置为0。
默认值:34vp | | autoReset | boolean | 设置是否支持用户在完成输入后再次触屏重置组件状态。如果设置为true,用户可以通过触摸图案密码锁重置组件状态(清除之前的输入效果);如果设置为false,用户手指离开屏幕完成输入后,再次触摸图案密码锁(包括圆点)不能改变之前的输入状态。
默认值:true | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md index 5248b2902f2888429f4510a141a3ba8b2eb22846..2e46582a93b5178bbae473ffb59976ee6127b103 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md @@ -52,8 +52,8 @@ Progress(options: {value: number, total?: number, type?: ProgressType}) | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | | value | number | 设置当前进度值。 | -| color | [ResourceColor](../../ui/ts-types.md) | 设置进度条前景色。 | -| style8+ | {
strokeWidth?: [Length](../../ui/ts-types.md#length),
scaleCount?: number,
scaleWidth?: [Length](../../ui/ts-types.md#length)
} | 定义组件的样式。
- strokeWidth: 设置进度条宽度。
- scaleCount: 设置环形进度条总刻度数。
- scaleWidth: 设置环形进度条刻度粗细,刻度粗细大于进度条宽度时,为系统默认粗细。 | +| color | [ResourceColor](ts-types.md) | 设置进度条前景色。 | +| style8+ | {
strokeWidth?: [Length](ts-types.md#length),
scaleCount?: number,
scaleWidth?: [Length](ts-types.md#length)
} | 定义组件的样式。
- strokeWidth: 设置进度条宽度。
- scaleCount: 设置环形进度条总刻度数。
- scaleWidth: 设置环形进度条刻度粗细,刻度粗细大于进度条宽度时,为系统默认粗细。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-qrcode.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-qrcode.md index b988fa3483cdcd60f07edfa57da9e55dec6579db..6fce76e8855930628d2cb05cd18d6ecd693e7be1 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-qrcode.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-qrcode.md @@ -27,8 +27,8 @@ QRCode(value: string) | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| color | [ResourceColor](../../ui/ts-types.md) | 设置二维码颜色。
默认值:Color.Black | -| backgroundColor | [ResourceColor](../../ui/ts-types.md) | 设置二维码背景颜色。
默认值:Color.White | +| color | [ResourceColor](ts-types.md) | 设置二维码颜色。
默认值:Color.Black | +| backgroundColor | [ResourceColor](ts-types.md) | 设置二维码背景颜色。
默认值:Color.White | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md index d4d84906cfa565b8ab0d68c46feab435ec241385..b0154381cbe100c4620b015fe1b3d35bcecea563 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md @@ -30,9 +30,9 @@ Search(options?: { value?: string; placeholder?: string; icon?: string; controll | 名称 | 参数类型 | 描述 | | ----------------------- | ------------------------------------------------ | ---------------------------------------------- | | searchButton | string | 搜索框末尾搜索按钮文本值,默认无搜索按钮。 | -| placeholderColor | [ResourceColor](../../ui/ts-types.md) | 设置placeholder颜色。 | -| placeholderFont | [Font](../../ui/ts-types.md) | 设置placeholder文本样式。 | -| textFont | [Font](../../ui/ts-types.md) | 设置搜索框内文本样式。 | +| placeholderColor | [ResourceColor](ts-types.md) | 设置placeholder颜色。 | +| placeholderFont | [Font](ts-types.md) | 设置placeholder文本样式。 | +| textFont | [Font](ts-types.md) | 设置搜索框内文本样式。 | | copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置文本是否可复制。 | | textAlign | [TextAlign](ts-appendix-enums.md#textalign) | 设置文本对齐方式。
默认值:TextAlign.Start | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md index d6b6e0cdbba6d7e2a1aaf23310525225a5eeaec8..f16df1e5379ffe226a169f75b24657ce83e06d43 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md @@ -18,8 +18,8 @@ Select(options: Array\) | 参数名 | 参数类型 | 必填 | 参数描述 | | ------ | ----------------------------------- | ---- | -------------- | -| value | [ResourceStr](../../ui/ts-types.md) | 是 | 下拉选项内容。 | -| icon | [ResourceStr](../../ui/ts-types.md) | 否 | 下拉选项图片。 | +| value | [ResourceStr](ts-types.md) | 是 | 下拉选项内容。 | +| icon | [ResourceStr](ts-types.md) | 否 | 下拉选项图片。 | ## 属性 @@ -27,14 +27,14 @@ Select(options: Array\) | ----------------------- | ------------------------------------- | --------------------------------------------- | | selected | number | 设置下拉菜单初始选项的索引,第一项的索引为0。 | | value | string | 设置下拉按钮本身的文本显示。 | -| font | [Font](../../ui/ts-types.md) | 设置下拉按钮本身的文本样式。 | -| fontColor | [ResourceColor](../../ui/ts-types.md) | 设置下拉按钮本身的文本颜色。 | -| selectedOptionBgColor | [ResourceColor](../../ui/ts-types.md) | 设置下拉菜单选中项的背景色。 | -| selectedOptionFont | [Font](../../ui/ts-types.md) | 设置下拉菜单选中项的文本样式。 | -| selectedOptionFontColor | [ResourceColor](../../ui/ts-types.md) | 设置下拉菜单选中项的文本颜色。 | -| optionBgColor | [ResourceColor](../../ui/ts-types.md) | 设置下拉菜单项的背景色。 | -| optionFont | [Font](../../ui/ts-types.md) | 设置下拉菜单项的文本样式。 | -| optionFontColor | [ResourceColor](../../ui/ts-types.md) | 设置下拉菜单项的文本颜色。 | +| font | [Font](ts-types.md) | 设置下拉按钮本身的文本样式。 | +| fontColor | [ResourceColor](ts-types.md) | 设置下拉按钮本身的文本颜色。 | +| selectedOptionBgColor | [ResourceColor](ts-types.md) | 设置下拉菜单选中项的背景色。 | +| selectedOptionFont | [Font](ts-types.md) | 设置下拉菜单选中项的文本样式。 | +| selectedOptionFontColor | [ResourceColor](ts-types.md) | 设置下拉菜单选中项的文本颜色。 | +| optionBgColor | [ResourceColor](ts-types.md) | 设置下拉菜单项的背景色。 | +| optionFont | [Font](ts-types.md) | 设置下拉菜单项的文本样式。 | +| optionFontColor | [ResourceColor](ts-types.md) | 设置下拉菜单项的文本颜色。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md index 3d41ae214cbc157aa119be3b6785236634e0055f..ed79c007dc9860285f67a96718cb748cb046eec2 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md @@ -42,12 +42,12 @@ Slider(options?: {value?: number, min?: number, max?: number, step?: number, sty | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| blockColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置滑块的颜色。 | -| trackColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置滑轨的背景颜色。 | -| selectedColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置滑轨的已滑动颜色。 | +| blockColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置滑块的颜色。 | +| trackColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置滑轨的背景颜色。 | +| selectedColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置滑轨的已滑动颜色。 | | showSteps | boolean | 设置当前是否显示步长刻度值。
默认值:false | | showTips | boolean | 设置滑动时是否显示气泡提示百分比。
默认值:false | -| trackThickness | [Length](../../ui/ts-types.md#length) | 设置滑轨的粗细。 | +| trackThickness | [Length](ts-types.md#length) | 设置滑轨的粗细。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md index 2e37770e82c0906e66a08a6c7fde2fd8fbeb9076..c017aaf3bdd3cf9f60da6026fb520430f443881b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md @@ -20,7 +20,7 @@ Span(content: string | Resource) | 参数名 | 参数类型 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -| content | string \| [Resource](../../ui/ts-types.md#resource) | 是 | 文本内容。 | +| content | string \| [Resource](ts-types.md#resource) | 是 | 文本内容。 | ## 属性 @@ -29,7 +29,7 @@ Span(content: string | Resource) | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| decoration | {
type: [TextDecorationType](ts-appendix-enums.md#textdecorationtype),
color?: [ResourceColor](../../ui/ts-types.md#resourcecolor8)
} | 设置文本装饰线样式及其颜色。
默认值:{
type: TextDecorationType.None
color:Color.Black
} | +| decoration | {
type: [TextDecorationType](ts-appendix-enums.md#textdecorationtype),
color?: [ResourceColor](ts-types.md#resourcecolor8)
} | 设置文本装饰线样式及其颜色。
默认值:{
type: TextDecorationType.None
color:Color.Black
} | | letterSpacing | number \| string | 设置文本字符间距。 | | textCase | [TextCase](ts-appendix-enums.md#textcase) | 设置文本大小写。
默认值:TextCase.Normal | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md index 1b114d66e82b9c703760d45802d58b78327aa168..a8f3a429ea6841fb79c9118dc5274ef048438a3a 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md @@ -20,7 +20,7 @@ Text(content?: string | Resource) | 参数名 | 参数类型 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -| content | string \| [Resource](../../ui/ts-types.md#resource) | 否 | 文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。
默认值:' ' | +| content | string \| [Resource](ts-types.md#resource) | 否 | 文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。
默认值:' ' | ## 属性 @@ -31,12 +31,12 @@ Text(content?: string | Resource) | textAlign | [TextAlign](ts-appendix-enums.md#textalign) | 设置多行文本的文本对齐方式。
默认值:TextAlign.Start | | textOverflow | {overflow: [TextOverflow](ts-appendix-enums.md#textoverflow)} | 设置文本超长时的显示方式。
默认值:{overflow: TextOverflow.Clip}
**说明:**
文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。
需配合`maxLines`使用,单独设置不生效。 | | maxLines | number | 设置文本的最大行数。
默认值:Infinity
**说明:**
默认情况下,文本是自动折行的,如果指定此参数,则文本最多不会超过指定的行。如果有多余的文本,可以通过 `textOverflow`来指定截断方式。 | -| lineHeight | string \| number \| [Resource](../../ui/ts-types.md) | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。 | -| decoration | {
type: TextDecorationType,
color?: [ResourceColor](../../ui/ts-types.md)
} | 设置文本装饰线样式及其颜色。
默认值:{
type: TextDecorationType.None,
color:Color.Black
} | +| lineHeight | string \| number \| [Resource](ts-types.md) | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。 | +| decoration | {
type: TextDecorationType,
color?: [ResourceColor](ts-types.md)
} | 设置文本装饰线样式及其颜色。
默认值:{
type: TextDecorationType.None,
color:Color.Black
} | | baselineOffset | number \| string | 设置文本基线的偏移量。 | | letterSpacing | number \| string | 设置文本字符间距。 | -| minFontSize | number \| string \| [Resource](../../ui/ts-types.md) | 设置文本最小显示字号。 | -| maxFontSize | number \| string \| [Resource](../../ui/ts-types.md) | 设置文本最大显示字号。 | +| minFontSize | number \| string \| [Resource](ts-types.md) | 设置文本最小显示字号。 | +| maxFontSize | number \| string \| [Resource](ts-types.md) | 设置文本最大显示字号。 | | textCase | [TextCase](ts-appendix-enums.md#textcase) | 设置文本大小写。
默认值:TextCase.Normal | | copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 组件支持设置文本是否可复制粘贴。
默认值:CopyOptions.None | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md index f9cf5c685b59792f5fa0f3b18599f4f55d54e524..a82812ec6012d65ccc72be0f43de19bc008cef9b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md @@ -20,8 +20,8 @@ TextArea(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Tex | 参数名 | 参数类型 | 必填 | 参数描述 | | ----------------------- | ---------------------------------------- | ---- | -------------- | -| placeholder | [ResourceStr](../../ui/ts-types.md) | 否 | 无输入时的提示文本。 | -| text | [ResourceStr](../../ui/ts-types.md) | 否 | 设置输入框当前的文本内容。 | +| placeholder | [ResourceStr](ts-types.md) | 否 | 无输入时的提示文本。 | +| text | [ResourceStr](ts-types.md) | 否 | 设置输入框当前的文本内容。 | | controller8+ | [TextAreaController](#textareacontroller8) | 否 | 设置TextArea控制器。 | @@ -31,11 +31,11 @@ TextArea(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Tex | 名称 | 参数类型 | 描述 | | ------------------------ | ---------------------------------------- | ---------------------------------------- | -| placeholderColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置placeholder文本颜色。 | -| placeholderFont | [Font](../../ui/ts-types.md#font) | 设置placeholder文本样式。 | +| placeholderColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置placeholder文本颜色。 | +| placeholderFont | [Font](ts-types.md#font) | 设置placeholder文本样式。 | | textAlign | [TextAlign](ts-appendix-enums.md#textalign) | 设置文本水平对齐式。
默认值:TextAlign.Start | -| caretColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置输入框光标颜色。 | -| inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md)8+,
error?: (value: string) => void
} | 通过正则表达式设置输入过滤器。满足表达式的输入允许显示,不满足的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,不支持过滤8到10位的强密码。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | +| caretColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置输入框光标颜色。 | +| inputFilter8+ | {
value: [ResourceStr](ts-types.md)8+,
error?: (value: string) => void
} | 通过正则表达式设置输入过滤器。满足表达式的输入允许显示,不满足的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,不支持过滤8到10位的强密码。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | | copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置文本是否可复制。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md index 7738ea1728fc319ceb35acfe575b1e9d11cd652f..e2e90e8c7b66220f57ef12136663289f333497e5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md @@ -20,8 +20,8 @@ TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Te | 参数名 | 参数类型 | 必填 | 参数描述 | | ----------------------- | ---------------------------------------- | ---- | --------------- | -| placeholder | [ResourceStr](../../ui/ts-types.md) | 否 | 无输入时的提示文本。 | -| text | [ResourceStr](../../ui/ts-types.md) | 否 | 设置输入框当前的文本内容。 | +| placeholder | [ResourceStr](ts-types.md) | 否 | 无输入时的提示文本。 | +| text | [ResourceStr](ts-types.md) | 否 | 设置输入框当前的文本内容。 | | controller8+ | [TextInputController](#textinputcontroller8) | 否 | 设置TextInput控制器。 | @@ -32,12 +32,12 @@ TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Te | 名称 | 参数类型 | 描述 | | ------------------------ | ---------------------------------------- | ---------------------------------------- | | type | InputType | 设置输入框类型。
默认值:InputType.Normal | -| placeholderColor | [ResourceColor](../../ui/ts-types.md) | 设置placeholder颜色。| -| placeholderFont | [Font](../../ui/ts-types.md#font) | 设置placeholder文本样式。 | +| placeholderColor | [ResourceColor](ts-types.md) | 设置placeholder颜色。| +| placeholderFont | [Font](ts-types.md#font) | 设置placeholder文本样式。 | | enterKeyType | EnterKeyType | 设置输入法回车键类型。
默认值:EnterKeyType.Done | -| caretColor | [ResourceColor](../../ui/ts-types.md) | 设置输入框光标颜色。 | +| caretColor | [ResourceColor](ts-types.md) | 设置输入框光标颜色。 | | maxLength | number | 设置文本的最大输入字符数。 | -| inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md)8+,
error?: (value: string) => void
} | 正则表达式,满足表达式的输入允许显示,不满足正则表达式的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,8到10位的强密码不支持过滤。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | +| inputFilter8+ | {
value: [ResourceStr](ts-types.md)8+,
error?: (value: string) => void
} | 正则表达式,满足表达式的输入允许显示,不满足正则表达式的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,8到10位的强密码不支持过滤。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | | copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置文本是否可复制。 | | showPasswordIcon9+ | boolean | 密码输入模式时,密码框末尾的图标是否显示。
默认值:true | | style9+ | TextInputStyle | TextInput风格。
默认值:TextInputStyle.Default | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md index d038685ddd81c123d9dded2a8da4b745fc5646d3..0f20ae9ed4d76f5c16e5842f027d3dfe316a6360 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md @@ -22,7 +22,7 @@ TextPicker(options?: {range: string[]|Resource, selected?: number, value?: strin | 参数名 | 参数类型 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -| range | string[] \| [Resource](../../ui/ts-types.md#resource类型) | 是 | 选择器的数据选择范围。 | +| range | string[] \| [Resource](ts-types.md#resource类型) | 是 | 选择器的数据选择范围。 | | selected | number | 否 | 选中项在数组中的index值。
默认值:0 | | value | string | 否 | 选中项的值,优先级低于selected。
默认值:第一个元素值 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-toggle.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-toggle.md index 8bca323f30a2569a7a781b462191cc17666d36cf..a892b4533c55cce6e2a8a229d5f0b2d0bdcdad0b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-toggle.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-toggle.md @@ -39,8 +39,8 @@ Toggle(options: { type: ToggleType, isOn?: boolean }) | 名称 | 参数 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -| selectedColor | [ResourceColor](../../ui/ts-types.md) | - | 设置组件打开状态的背景颜色。 | -| switchPointColor | [ResourceColor](../../ui/ts-types.md) | - | 设置Switch类型的圆形滑块颜色。
> **说明:**
> 仅对type为ToggleType.Switch生效。 | +| selectedColor | [ResourceColor](ts-types.md) | - | 设置组件打开状态的背景颜色。 | +| switchPointColor | [ResourceColor](ts-types.md) | - | 设置Switch类型的圆形滑块颜色。
> **说明:**
> 仅对type为ToggleType.Switch生效。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md index c9dc3bdf1c6bd48799bde4a4bd980eca42dd2957..8dd92b4bab6ec93821d1a11adbd93dc8a167043d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md @@ -26,7 +26,7 @@ Web(options: { src: ResourceStr, controller: WebController }) | 参数名 | 参数类型 | 必填 | 参数描述 | | ---------- | ------------------------------- | ---- | ------- | -| src | [ResourceStr](../../ui/ts-types.md) | 是 | 网页资源地址。 | +| src | [ResourceStr](ts-types.md) | 是 | 网页资源地址。 | | controller | [WebController](#webcontroller) | 否 | 控制器。 | **示例:** diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md index b5c763ced54c42266450d001877d930aea03bf28..360c035961184598a4aed2e8419f96c7e6dbd1e0 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md @@ -29,19 +29,19 @@ AlphabetIndexer(value: {arrayValue: Array<string>, selected: number}) | 名称 | 参数类型 | 描述 | | ----------------------- | --------------- | ----------------------------------------------------------- | -| color | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置文字颜色。 | -| selectedColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置选中项文字颜色。 | -| popupColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置提示弹窗文字颜色。 | -| selectedBackgroundColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置选中项背景颜色。 | -| popupBackground | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | 设置提示弹窗背景色。 | +| color | [ResourceColor](ts-types.md#resourcecolor8) | 设置文字颜色。 | +| selectedColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置选中项文字颜色。 | +| popupColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置提示弹窗文字颜色。 | +| selectedBackgroundColor | [ResourceColor](ts-types.md#resourcecolor8) | 设置选中项背景颜色。 | +| popupBackground | [ResourceColor](ts-types.md#resourcecolor8) | 设置提示弹窗背景色。 | | usingPopup | boolean | 设置是否使用提示弹窗。 | -| selectedFont | [Font](../../ui/ts-types.md#font) | 设置选中项文字样式。 | -| popupFont | [Font](../../ui/ts-types.md#font) | 设置提示弹窗字体样式。 | -| font | [Font](../../ui/ts-types.md#font) | 设置字母索引条默认字体样式。 | +| selectedFont | [Font](ts-types.md#font) | 设置选中项文字样式。 | +| popupFont | [Font](ts-types.md#font) | 设置提示弹窗字体样式。 | +| font | [Font](ts-types.md#font) | 设置字母索引条默认字体样式。 | | itemSize | string \| number | 设置字母索引条字母区域大小,字母区域为正方形,即正方形边长。 | | alignStyle | IndexerAlign | 设置字母索引条弹框的对齐样式,支持弹窗显示在索引条右侧和左侧。
默认值:IndexerAlign.Right | | selected | number | 设置选中项索引值。 | -| popupPosition | [Position](../../ui/ts-types.md#position8) | 设置弹出窗口相对于索引器条上边框中点的位置。 | +| popupPosition | [Position](ts-types.md#position8) | 设置弹出窗口相对于索引器条上边框中点的位置。 | ## IndexerAlign枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-badge.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-badge.md index 6990d3d93cd24b5db073a41604b31943ad14fd9e..8f2a910b2c9d77290d39fd9ab8cea07acd445b09 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-badge.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-badge.md @@ -44,10 +44,10 @@ - BadgeStyle对象说明 | 名称 | 类型 | 必填 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -------- | - | color | [ResourceColor](../../ui/ts-types.md) | 否 | Color.White | 文本颜色。 | + | color | [ResourceColor](ts-types.md) | 否 | Color.White | 文本颜色。 | | fontSize | number \| string | 否 | 10 | 文本大小。 | | badgeSize | number \| string | 是 | - | badge的大小。 | - | badgeColor | [ResourceColor](../../ui/ts-types.md) | 否 | Color.Red | badge的颜色。 | + | badgeColor | [ResourceColor](ts-types.md) | 否 | Color.Red | badge的颜色。 | - BadgePosition枚举说明 | 名称 | 描述 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md index 9b0fccc3963d9253f75bf8da3a897332481ea292..ecb10b7fc2307f5bdff58946f559d3493a3104fe 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md @@ -32,14 +32,14 @@ List(value?:{space?: number | string, initialIndex?: number, scroller? | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | | listDirection | [Axis](ts-appendix-enums.md#axis) | 设置List组件排列方向。
默认值:Axis.Vertical | -| divider | {
strokeWidth: [Length](../../ui/ts-types.md#length),
color?:[ResourceColor](../../ui/ts-types.md),
startMargin?: Length,
endMargin?: Length
} \| null | 设置ListItem分割线样式,默认无分割线。
- strokeWidth: 分割线的线宽。
- color: 分割线的颜色。
- startMargin: 分割线与列表侧边起始端的距离。
- endMargin: 分割线与列表侧边结束端的距离。 | +| divider | {
strokeWidth: [Length](ts-types.md#length),
color?:[ResourceColor](ts-types.md),
startMargin?: Length,
endMargin?: Length
} \| null | 设置ListItem分割线样式,默认无分割线。
- strokeWidth: 分割线的线宽。
- color: 分割线的颜色。
- startMargin: 分割线与列表侧边起始端的距离。
- endMargin: 分割线与列表侧边结束端的距离。 | | scrollBar | [BarState](ts-appendix-enums.md#barstate) | 设置滚动条状态。
默认值:BarState.Off | | cachedCount | number | 设置预加载的ListItem数量。具体使用可参考[减少应用白块说明](../../ui/ts-performance-improvement-recommendation.md#减少应用滑动白块)。
默认值:1 | | editMode | boolean | 声明当前List组件是否处于可编辑模式。
默认值:false | | edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | 设置组件的滑动效果。
默认值:EdgeEffect.Spring | | chainAnimation | boolean | 设置当前List是否启用链式联动动效,开启后列表滑动以及顶部和底部拖拽时会有链式联动的效果。链式联动效果:List内的list-item间隔一定距离,在基本的滑动交互行为下,主动对象驱动从动对象进行联动,驱动效果遵循弹簧物理动效。
默认值:false
- false:不启用链式联动。
- true:启用链式联动。 | | multiSelectable8+ | boolean | 是否开启鼠标框选。
默认值:false
- false:关闭框选。
- true:开启框选。 | -| lanes9+ | number \| [LengthConstrain](../../ui/ts-types.md#lengthconstrain) | 以列模式为例(listDirection为Axis.Vertical):
lanes用于决定List组件在交叉轴方向按几列布局。
默认值:1
规则如下:
- lanes为指定的数量时,根据指定的数量与List组件的交叉轴宽度来决定每列的宽度;
- lane设置了{minLength,maxLength}时,根据List组件的宽度自适应决定lanes数量(即列数),保证缩放过程中lane的宽度符合{minLength,maxLength}的限制。其中,minLength条件会被优先满足,即优先保证符合ListItem的宽度符合最小宽度限制。例如在列模式下,设置了{minLength: 40vp,maxLength: 60vp},则当List组件宽度为70vp时,ListItem为一列,并且根据alignListItem属性做靠左、居中或者靠右布局;当List组件宽度变化至80vp时,符合两倍的minLength,则ListItem自适应为两列。 | +| lanes9+ | number \| [LengthConstrain](ts-types.md#lengthconstrain) | 以列模式为例(listDirection为Axis.Vertical):
lanes用于决定List组件在交叉轴方向按几列布局。
默认值:1
规则如下:
- lanes为指定的数量时,根据指定的数量与List组件的交叉轴宽度来决定每列的宽度;
- lane设置了{minLength,maxLength}时,根据List组件的宽度自适应决定lanes数量(即列数),保证缩放过程中lane的宽度符合{minLength,maxLength}的限制。其中,minLength条件会被优先满足,即优先保证符合ListItem的宽度符合最小宽度限制。例如在列模式下,设置了{minLength: 40vp,maxLength: 60vp},则当List组件宽度为70vp时,ListItem为一列,并且根据alignListItem属性做靠左、居中或者靠右布局;当List组件宽度变化至80vp时,符合两倍的minLength,则ListItem自适应为两列。 | | alignListItem9+ | ListItemAlign | List交叉轴方向宽度大于ListItem交叉轴宽度 * lanes时,ListItem在List交叉轴方向的布局方式,默认为居中。
默认值:ListItemAlign.Center | | sticky9+ | StickyStyle | 配合[ListItemGroup](ts-container-listitemgroup.md)组件使用,设置ListItemGroup中header和footer是否要吸顶或吸底。
默认值:StickyStyle.None
**说明:**
sticky属性可以设置为 StickyStyle.Header \| StickyStyle.Footer 以同时支持header吸顶和footer吸底。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-listitemgroup.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-listitemgroup.md index fe5ab429da78b43674881cccc976ef768092b188..d9c1b34bf09f77b677ba7dfb9d7e9f137d3661da 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-listitemgroup.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-listitemgroup.md @@ -23,15 +23,15 @@ ListItemGroup(options?: {header?: CustomBuilder, footer?: CustomBuilder, space?: | 参数名 | 参数类型 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | - | header | [CustomBuilder](../../ui/ts-types.md#custombuilder8) | 否 | 设置ListItemGroup头部组件。 | - | footer | [CustomBuilder](../../ui/ts-types.md#custombuilder8) | 否 | 设置ListItemGroup尾部组件。 | + | header | [CustomBuilder](ts-types.md#custombuilder8) | 否 | 设置ListItemGroup头部组件。 | + | footer | [CustomBuilder](ts-types.md#custombuilder8) | 否 | 设置ListItemGroup尾部组件。 | | space | number \| string | 否 | 列表项间距。只作用于ListItem与ListItem之间,不作用于header与ListItem、footer与ListItem之间。 | ## 属性 | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| divider | {
strokeWidth: [Length](../../ui/ts-types.md#length),
color?: [ResourceColor](../../ui/ts-types.md#resourcecolor8),
startMargin?: [Length](../../ui/ts-types.md#length),
endMargin?: [Length](../../ui/ts-types.md#length)
} \| null | 用于设置ListItem分割线样式,默认无分割线。
strokeWidth: 分割线的线宽。
color: 分割线的颜色。
startMargin: 分割线距离列表侧边起始端的距离。
endMargin: 分割线距离列表侧边结束端的距离。 | +| divider | {
strokeWidth: [Length](ts-types.md#length),
color?: [ResourceColor](ts-types.md#resourcecolor8),
startMargin?: [Length](ts-types.md#length),
endMargin?: [Length](ts-types.md#length)
} \| null | 用于设置ListItem分割线样式,默认无分割线。
strokeWidth: 分割线的线宽。
color: 分割线的颜色。
startMargin: 分割线距离列表侧边起始端的距离。
endMargin: 分割线距离列表侧边结束端的距离。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md index cebd4995112ee15c038b72e4e1e08bbcb595b408..2ec1c332acda20a888d6687962b2ff377e8a6a8d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md @@ -34,7 +34,7 @@ Panel(show:boolean) | halfHeight | string \| number | 指定PanelMode.Half状态下的高度,默认为屏幕尺寸的一半。 | | miniHeight | string \| number | 指定PanelMode.Mini状态下的高度。 | | show | boolean | 当滑动面板弹出时调用。 | -| backgroundMask9+|[ResourceColor](../../ui/ts-types.md#resourcecolor8)|指定Panel的背景蒙层。| +| backgroundMask9+|[ResourceColor](ts-types.md#resourcecolor8)|指定Panel的背景蒙层。| ## PanelType枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md index 7032115bf6cf45431ce8ba64d6c151fb426ad787..c1744c1b1ecb5b053877232fed1a29dd882dade3 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md @@ -50,7 +50,7 @@ SideBarContainer( type?: SideBarContainerType ) | top | number | 否 | 设置侧边栏控制按钮距离容器上界限的间距。
默认值:48,单位vp | | width | number | 否 | 设置侧边栏控制按钮的宽度。
默认值:32,单位vp | | height | number | 否 | 设置侧边栏控制按钮的高度。
默认值:32,单位vp | -| icons | {
shown: string \| PixelMap \| [Resource](../../ui/ts-types.md) ,
hidden: string \| PixelMap \| [Resource](../../ui/ts-types.md) ,
switching?: string \| PixelMap \| [Resource](../../ui/ts-types.md)
} | 否 | 设置侧边栏控制按钮的图标:

- shown: 设置侧边栏显示时控制按钮的图标。
- hidden: 设置侧边栏隐藏时控制按钮的图标。
- switching:设置侧边栏显示和隐藏状态切换时控制按钮的图标。 | +| icons | {
shown: string \| PixelMap \| [Resource](ts-types.md) ,
hidden: string \| PixelMap \| [Resource](ts-types.md) ,
switching?: string \| PixelMap \| [Resource](ts-types.md)
} | 否 | 设置侧边栏控制按钮的图标:

- shown: 设置侧边栏显示时控制按钮的图标。
- hidden: 设置侧边栏隐藏时控制按钮的图标。
- switching:设置侧边栏显示和隐藏状态切换时控制按钮的图标。 | ## SideBarPosition9+枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md index 5a523dd57d9a658b14a3dd6050d9cedd4123613a..30949d64161ba76be0f24cc4da25309ccdfa10f0 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md @@ -41,7 +41,7 @@ Swiper(value:{controller?: SwiperController}) | cachedCount8+ | number | 设置预加载子组件个数。
默认值:1 | | disableSwipe8+ | boolean | 禁用组件滑动切换功能。
默认值:false | | curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-appendix-enums.md#curve),也可以通过插值计算模块提供的接口创建自定义的Curves([插值曲线对象](ts-interpolation-calculation.md))。
默认值:Curve.Ease | -| indicatorStyle8+ | {
left?: [Length](../../ui/ts-types.md#length),
top?: [Length](../../ui/ts-types.md#length),
right?: [Length](../../ui/ts-types.md#length),
bottom?: [Length](../../ui/ts-types.md#length),
size?: [Length](../../ui/ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](../../ui/ts-types.md),
selectedColor?: [ResourceColor](../../ui/ts-types.md)
} | 设置导航点样式:
\- left: 设置导航点距离Swiper组件左边的距离。
\- top: 设置导航点距离Swiper组件顶部的距离。
\- right: 设置导航点距离Swiper组件右边的距离。
\- bottom: 设置导航点距离Swiper组件底部的距离。
\- size: 设置导航点的直径。
\- mask: 设置是否显示导航点蒙层样式。
\- color: 设置导航点的颜色。
\- selectedColor: 设置选中的导航点的颜色。 | +| indicatorStyle8+ | {
left?: [Length](ts-types.md#length),
top?: [Length](ts-types.md#length),
right?: [Length](ts-types.md#length),
bottom?: [Length](ts-types.md#length),
size?: [Length](ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](ts-types.md),
selectedColor?: [ResourceColor](ts-types.md)
} | 设置导航点样式:
\- left: 设置导航点距离Swiper组件左边的距离。
\- top: 设置导航点距离Swiper组件顶部的距离。
\- right: 设置导航点距离Swiper组件右边的距离。
\- bottom: 设置导航点距离Swiper组件底部的距离。
\- size: 设置导航点的直径。
\- mask: 设置是否显示导航点蒙层样式。
\- color: 设置导航点的颜色。
\- selectedColor: 设置选中的导航点的颜色。 | | displayCount8+ | number\|string | 设置元素显示个数。
默认值:1 | | effectMode8+ | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。
默认值:EdgeEffect.Spring | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md index a23c17552d46553a65d1e95b9002cdb75ab345e3..d2e6c7f80e18c245d0b8e913c97e9ea330f3352f 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md @@ -23,7 +23,7 @@ TabContent() | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| tabBar | string \| Resource \| {
icon?: string \| Resource,
text?: string \| Resource
}
\| [CustomBuilder](../../ui/ts-types.md)8+ | 设置TabBar上显示内容。
CustomBuilder: 构造器,内部可以传入组件(API8版本以上适用)。
>  **说明:**
> 如果icon采用svg格式图源,则要求svg图源删除其自有宽高属性值。如采用带有自有宽高属性的svg图源,icon大小则是svg本身内置的宽高属性值大小。 | +| tabBar | string \| Resource \| {
icon?: string \| Resource,
text?: string \| Resource
}
\| [CustomBuilder](ts-types.md)8+ | 设置TabBar上显示内容。
CustomBuilder: 构造器,内部可以传入组件(API8版本以上适用)。
>  **说明:**
> 如果icon采用svg格式图源,则要求svg图源删除其自有宽高属性值。如采用带有自有宽高属性的svg图源,icon大小则是svg本身内置的宽高属性值大小。 | > **说明:** > - TabContent组件不支持设置通用宽度属性,其宽度默认撑满Tabs父组件。 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 c641e7932e0d6362d5dabae55aff65c61698ba3f..a3f690f5f5e7a8fa685b33d0906939d319d1501c 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 @@ -28,15 +28,15 @@ Circle(options?: {width?: string | number, height?: string | number}) | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| 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 | 否 | 设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](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 64040cc7ef99db510cb0877be8f110b083461ff3..6558f3733f669d7a05500e802d68d35c0715cacc 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 @@ -29,15 +29,15 @@ ellipse(options?: {width?: string | number, height?: string | number}) | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| 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 | 否 |设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](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 b2b3785ce0ca51bba69401f9dec96793275cf2f7..3e51c861165a58651c57dae9c344177217e14a18 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 @@ -36,15 +36,15 @@ Line(options?: {width?: string | number, height?: string | number}) | -------- | -------- | -------- | -------- | -------- | | 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 | 否 | 设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](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 eadf46951de6851dd445b39db72b0516bb8f7e74..372b056e1951d565b0bf50f566526cebcd26cf4e 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 @@ -30,15 +30,15 @@ Path(value?: { width?: number | string; height?: number | string; commands?: str | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | ----------------------------------- | ---- | ---- | ---------------------------------------- | | 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 | 否 | 设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | | strokeWidth | Length | 1 | 否 | 设置线条宽度。 | | antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | 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 f9f2674cbe0892bd983de4bd2b45a7f28ab76907..640d8cff9a544e495ede82b1dedf500af2e79fb3 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 @@ -30,15 +30,15 @@ Polygon(options?: {width?: string | number, height?: string | number}) | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | | 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 | 否 | 设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | | strokeWidth | Length | 1 | 否 | 设置线条宽度。 | | antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | 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 cf2d0ea085fb49e14aaa9d59ac909af218ef2ba9..d650c783667355475a221b892064b728978b1492 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 @@ -30,15 +30,15 @@ Polyline(options?: {width?: string | number, height?: string | number}) | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | | 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 | 否 | 设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置线条透明度。 | | strokeWidth | Length | 1 | 否 | 设置线条宽度。 | | antiAlias | boolean | true | 否 | 是否开启抗锯齿效果。 | 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 53ff413ddd1793b97d0fec303564b28aa85fa857..0b3477c98e16a53b88e09519b453cb92dea57cea 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 @@ -36,15 +36,15 @@ Rect(options?: {width?: string | number,height?: string | number,radius?: string | 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 | 否 | 设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](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 0d75477d8c16d9f8a7bc077977a849f874e93ff1..2c912ca38081d058f5467cd0efb5cf01e8cd9ba8 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 @@ -34,15 +34,15 @@ Shape(value?: PixelMap) | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | | 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 | 否 | 设置线条颜色。 | +| fill | [ResourceColor](ts-types.md) | Color.Black | 否 | 设置填充区域颜色。 | +| fillOpacity | number \| string \| [Resource](ts-types.md#resource类型) | 1 | 否 | 设置填充区域透明度。 | +| stroke | [ResourceColor](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 | 否 | 设置线条透明度。 | +| strokeOpacity | number \| string \| [Resource](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。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-media-components-video.md b/zh-cn/application-dev/reference/arkui-ts/ts-media-components-video.md index 05591aaf496e148eb2f9d950d42eb69842fe2368..b504929e733dbc57385d8bcf492d605603587bf3 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-media-components-video.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-media-components-video.md @@ -24,9 +24,9 @@ Video(value: {src?: string | Resource, currentProgressRate?: number | string | P | 参数名 | 参数类型 | 必填 | 参数描述 | | ------------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| src | string \| [Resource](../../ui/ts-types.md) | 否 | 视频播放源的路径,支持本地视频路径和网络路径。
支持在resources下面的video或rawfile文件夹里放置媒体资源。
支持dataability://的路径前缀,用于访问通过Data Ability提供的视频路径,具体路径信息详见[Data Ability说明](../../ability/fa-dataability.md)。
**说明:**
视频支持的规格是:mp4、mkv、webm、TS。 | +| src | string \| [Resource](ts-types.md) | 否 | 视频播放源的路径,支持本地视频路径和网络路径。
支持在resources下面的video或rawfile文件夹里放置媒体资源。
支持dataability://的路径前缀,用于访问通过Data Ability提供的视频路径,具体路径信息详见[Data Ability说明](../../ability/fa-dataability.md)。
**说明:**
视频支持的规格是:mp4、mkv、webm、TS。 | | currentProgressRate | number \| string \| PlaybackSpeed8+ | 否 | 视频播放倍速。
**说明:**
number取值仅支持:0.75,1.0,1.25,1.75,2.0。
默认值:1.0 \| PlaybackSpeed.Speed_Forward_1_00_X | -| previewUri | string \| PixelMap8+ \| [Resource](../../ui/ts-types.md) | 否 | 预览图片的路径。 | +| previewUri | string \| PixelMap8+ \| [Resource](ts-types.md) | 否 | 预览图片的路径。 | | controller | [VideoController](#videocontroller) | 否 | 控制器。 | ## PlaybackSpeed8+枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md index c4f236ec93bb4b595cd0b9ab33e6abc2c94205d7..f03fcd0d0f1256be6992e1b18ee1c5ec3904822b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md @@ -21,10 +21,10 @@ show(value: { title: string | Resource, message: string  | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | title | string \| [Resource](../../ui/ts-types.md#resource) | 是 | - | 弹窗标题。 | - | message | string \| [Resource](../../ui/ts-types.md#resource) | 是 | - | 弹窗内容。 | + | title | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗标题。 | + | message | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗内容。 | | autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | - | confirm | {
value: string \| [Resource](../../ui/ts-types.md#resource),
action: () => void
} | 否 | - | 确认按钮的文本内容和点击回调。
value:按钮文本内容。
action: 按钮选中时的回调。 | + | confirm | {
value: string \| [Resource](ts-types.md#resource),
action: () => void
} | 否 | - | 确认按钮的文本内容和点击回调。
value:按钮文本内容。
action: 按钮选中时的回调。 | | cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | | alignment | [DialogAlignment](ts-methods-custom-dialog-box.md) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | | offset | {
dx: Length,
dy: Length
} | 否 | {
dx: 0,
dy: 0
} | 弹窗相对alignment所在位置的偏移量。 | @@ -34,8 +34,8 @@ show(value: { title: string | Resource, message: string  | 参数名 | 参数类型 | 必填 | 参数描述 | | ------ | ------------------------------------------------------------ | ---- | ----------------- | - | title | string \| [Resource](../../ui/ts-types.md#resource) | 是 | 选项的文本内容。 | - | icon | string \| [Resource](../../ui/ts-types.md#resource) | 否 | 选项的图标,默认无图标显示。 | + | title | string \| [Resource](ts-types.md#resource) | 是 | 选项的文本内容。 | + | icon | string \| [Resource](ts-types.md#resource) | 否 | 选项的图标,默认无图标显示。 | | action | ()=>void | 是 | 选项选中的回调。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md index 12d8a07c2993170cd7da94157628fb3f607f58fd..b323eb9378415d28933e2eb8d126d84088e92df7 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md @@ -15,26 +15,26 @@ ## AlertDialogParamWithConfirm对象说明 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | title | string \| [Resource](../../ui/ts-types.md#resource类型) | 否 | - | 弹窗标题。 | - | message | string \| [Resource](../../ui/ts-types.md#resource类型) | 是 | - | 弹窗内容。 | + | title | string \| [Resource](ts-types.md#resource类型) | 否 | - | 弹窗标题。 | + | message | string \| [Resource](ts-types.md#resource类型) | 是 | - | 弹窗内容。 | | autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | - | confirm | {
value: string \| [Resource](../../ui/ts-types.md#resource类型),
fontColor?: Color \| number \| string \| [Resource](../../ui/ts-types.md#resource类型),
backgroundColor?: Color \| number \| string \| [Resource](../../ui/ts-types.md#resource类型),
action: () => void
} | 否 | - | 确认按钮的文本内容、文本色、按钮背景色和点击回调。 | + | confirm | {
value: string \| [Resource](ts-types.md#resource类型),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource类型),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource类型),
action: () => void
} | 否 | - | 确认按钮的文本内容、文本色、按钮背景色和点击回调。 | | cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | | alignment | [DialogAlignment](ts-methods-custom-dialog-box.md) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | - | offset | {
dx: Length \| [Resource](../../ui/ts-types.md#resource类型),
dy: Length  \| [Resource](../../ui/ts-types.md#resource类型)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | + | offset | {
dx: Length \| [Resource](ts-types.md#resource类型),
dy: Length  \| [Resource](ts-types.md#resource类型)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | | gridCount | number | 否 | - | 弹窗容器宽度所占用栅格数。 | ## AlertDialogParamWithButtons对象说明 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | title | string \| [Resource](../../ui/ts-types.md#resource类型) | 否 | - | 弹窗标题。 | - | message | string \| [Resource](../../ui/ts-types.md#resource类型) | 是 | - | 弹窗内容。 | + | title | string \| [Resource](ts-types.md#resource类型) | 否 | - | 弹窗标题。 | + | message | string \| [Resource](ts-types.md#resource类型) | 是 | - | 弹窗内容。 | | autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | - | primaryButton | {
value: string \| [Resource](../../ui/ts-types.md#resource类型),
fontColor?: Color \| number \| string \| [Resource](../../ui/ts-types.md#resource类型),
backgroundColor?: Color \| number \| string \| [Resource](../../ui/ts-types.md#resource类型),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | - | secondaryButton | {
value: string \| [Resource](../../ui/ts-types.md#resource类型),
fontColor?: Color \| number \| string \| [Resource](../../ui/ts-types.md#resource类型),
backgroundColor?: Color \| number \| string \| [Resource](../../ui/ts-types.md#resource类型),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | + | primaryButton | {
value: string \| [Resource](ts-types.md#resource类型),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource类型),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource类型),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | + | secondaryButton | {
value: string \| [Resource](ts-types.md#resource类型),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource类型),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource类型),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | | cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | | alignment | [DialogAlignment](ts-methods-custom-dialog-box.md) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | - | offset | {
dx: Length \| [Resource](../../ui/ts-types.md#resource类型),
dy: Length  \| [Resource](../../ui/ts-types.md#resource类型)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | + | offset | {
dx: Length \| [Resource](ts-types.md#resource类型),
dy: Length  \| [Resource](ts-types.md#resource类型)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | | gridCount | number | 否 | - | 弹窗容器宽度所占用栅格数。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md index da83aa7d4459f4fe9fffefe6dc2a248ada8c2e7b..be90e66cc0ab2da4beec22f2ebac93dc24c49683 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md @@ -21,7 +21,7 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () => void, aut | cancel | () => void | 否 | - | 点击遮障层退出时的回调。 | | autoCancel | boolean | 否 | true | 是否允许点击遮障层退出。 | | alignment | DialogAlignment | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | - | offset | {
dx: Length \| [Resource](../../ui/ts-types.md#resource类型),
dy: Length  \| [Resource](../../ui/ts-types.md#resource类型)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | + | offset | {
dx: Length \| [Resource](ts-types.md#resource类型),
dy: Length  \| [Resource](ts-types.md#resource类型)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | | customStyle | boolean | 否 | false | 弹窗容器样式是否自定义。 | | gridCount8+ | number | 否 | - | 弹窗宽度占栅格宽度的个数。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-types.md b/zh-cn/application-dev/reference/arkui-ts/ts-types.md new file mode 100644 index 0000000000000000000000000000000000000000..3631983ddb1e71ce14289b1a9982e87e0db66629 --- /dev/null +++ b/zh-cn/application-dev/reference/arkui-ts/ts-types.md @@ -0,0 +1,217 @@ +# 类型定义 + +## Resource + +资源引用类型,用于设置组件属性的值。 + +可以通过`$r`或者`$rawfile`创建Resource类型对象,不可以修改Resource中的各属性的值。 + +- `$r('belonging.type.name')` + + belonging:系统资源或者应用资源,相应的取值为'sys'和'app'; + + type:资源类型,支持'color'、'float'、'string'、'media'等; + + name:资源名称,在资源定义时确定。 + +- `$rawfile('filename')` + + filename:工程中resources/rawfile目录下的文件名称。 + +## Length + +长度类型,用于描述尺寸单位。 + +| 类型 | 说明 | +| -------- | -------------------------------------- | +| string | 需要显式指定像素单位,如'10px',也可设置百分比字符串,如'100%'。 | +| number | 默认单位vp。 | +| Resource | 使用引入资源的方式,引入系统资源或者应用资源中的尺寸。 | + +## ResourceStr8+ + +字符串类型,用于描述字符串入参可以使用的类型。 + +| 类型 | 说明 | +| -------- | ---------------------------- | +| string | 字符串类型。 | +| Resource | 使用引入资源的方式,引入系统资源或者应用资源中的字符串。 | + +## Padding + +内边距类型,用于描述组件不同方向的内边距。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | --------------- | +| top | Length | 否 | 组件内元素距组件顶部的尺寸。 | +| right | Length | 否 | 组件内元素距组件右边界的尺寸。 | +| bottom | Length | 否 | 组件内元素距组件底部的尺寸。 | +| left | Length | 否 | 组件内元素距组件左边界的尺寸。 | + +## Margin + +外边距类型,用于描述组件不同方向的外边距。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | --------------- | +| top | Length | 否 | 组件外元素距组件顶部的尺寸。 | +| right | Length | 否 | 组件外元素距组件右边界的尺寸。 | +| bottom | Length | 否 | 组件外元素距组件底部的尺寸。 | +| left | Length | 否 | 组件外元素距组件左边界的尺寸。 | + +## EdgeWidths9+ + +边框宽度类型,用于描述组件边框不同方向的宽度。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | -------- | +| top | Length | 否 | 组件上边框宽度。 | +| right | Length | 否 | 组件右边框宽度。 | +| bottom | Length | 否 | 组件下边框宽度。 | +| left | Length | 否 | 组件左边框宽度。 | + +## BorderRadiuses9+ + +圆角类型,用于描述组件边框圆角半径。 + +| 名称 | 类型 | 必填 | 说明 | +| ----------- | ------ | ---- | ---------- | +| topLeft | Length | 否 | 组件左上角圆角半径。 | +| topRight | Length | 否 | 组件右上角圆角半径。 | +| bottomLeft | Length | 否 | 组件左下角圆角半径。 | +| bottomRight | Length | 否 | 组件右下角圆角半径。 | + +## EdgeColors9+ + +边框颜色,用于描述组件边框四条边的颜色。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ------------- | ---- | -------- | +| top | ResourceColor | 否 | 组件上边框颜色。 | +| right | ResourceColor | 否 | 组件右边框颜色。 | +| bottom | ResourceColor | 否 | 组件下边框颜色。 | +| left | ResourceColor | 否 | 组件左边框颜色。 | + +## EdgeStyles9+ + +边框样式,用于描述组件边框四条边的样式。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ----------- | ---- | -------- | +| top | BorderStyle | 否 | 组件上边框样式。 | +| right | BorderStyle | 否 | 组件右边框样式。 | +| bottom | BorderStyle | 否 | 组件下边框样式。 | +| left | BorderStyle | 否 | 组件左边框样式。 | + + +## Offset + +相对布局完成位置坐标偏移量。 + +| 名称 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | -------- | +| dx | Length | 是 | 水平方向偏移量。 | +| dy | Length | 是 | 竖直方向偏移量。 | + +## ResourceColor8+ + +颜色类型,用于描述资源颜色类型。 + +| 类型 | 说明 | +| ---------------------------------------- | --------------------------- | +| [Color](../reference/arkui-ts/ts-appendix-enums.md#color) | 颜色枚举值。 | +| number | HEX格式颜色。 | +| string | rgb或者rgba格式颜色。 | +| Resource | 使用引入资源的方式,引入系统资源或者应用资源中的颜色。 | + +## LengthConstrain + +长度约束,用于对组件最大、最小长度做限制。 + +| 名称 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | ------- | +| minLength | Length | 是 | 组件最小长度。 | +| maxLength | Length | 是 | 组件最大长度。 | + + +## Font + +设置文本样式。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ---------------------------------------- | ---- | ---------------------------------------- | +| size | [Length](#length) | 否 | 设置文本尺寸,Length为number类型时,使用fp单位。 | +| weight | [FontWeight](../reference/arkui-ts/ts-appendix-enums.md#fontweight) \| number \| string | 否 | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。 | +| family | string \| [Resource](#resource) | 否 | 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial, sans-serif'。 | +| style | [FontStyle](../reference/arkui-ts/ts-appendix-enums.md#fontstyle) | 否 | 设置文本的字体样式。 | + +## Area8+ + +区域类型,用于存储元素所占区域信息 + +| 名称 | 类型 | 说明 | +| -------------- | ---------------------- | ------------------------------ | +| width | [Length](#length) | 目标元素的宽度,作为返回值时,类型为number,单位vp。 | +| height | [Length](#length) | 目标元素的高度,作为返回值时,类型为number,单位vp。 | +| position | [Position](#position8) | 目标元素左上角相对父元素左上角的位置。 | +| globalPosition | [Position](#position8) | 目标元素左上角相对页面左上角的位置。 | + + +## Position8+ + +位置类型,用于表示一个坐标点。 + +| 名称 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | --------------------------- | +| x | Length | 否 | x轴坐标,作为返回值时,类型为number,单位vp。 | +| y | Length | 否 | y轴坐标,作为返回值时,类型为number,单位vp。 | + +## ConstraintSizeOptions + +设置约束尺寸,组件布局时,进行尺寸范围限制。 + +| 名称 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | ------- | +| minWidth | Length | 否 | 元素最小宽度。 | +| maxWidth | Length | 否 | 元素最大宽度。 | +| minHeight | Length | 否 | 元素最小高度。 | +| maxHeight | Length | 否 | 元素最大高度。 | + +## SizeOptions + +设置宽高尺寸。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ----- | +| width | Length | 否 | 元素宽度。 | +| height | Length | 否 | 元素高度。 | + + +## BorderOptions + +边框属性集合,用于描述边框相关信息。 + +| 名称 | 类型 | 必填 | 说明 | +| ------ | ---------------------------------------- | ---- | ------- | +| width | Length \| EdgeWidths9+ | 否 | 边框宽度。 | +| color | ResourceColor \| EdgeColors9+ | 否 | 边框颜色。 | +| radius | Length \| BorderRadiuses9+ | 否 | 边框圆角半径。 | +| style | [BorderStyle](../reference/arkui-ts/ts-appendix-enums.md#borderstyle) \| EdgeStyles9+ | 否 | 边框样式。 | + +## ColorFilter9+ + +创建具有4*5矩阵的颜色过滤器。 + +| 名称 | 类型 | 必填 | 描述 | +| ----------- | -------- | ---- | ---------------------------------------- | +| constructor | number[] | 是 | 创建具有4*5矩阵的颜色过滤器, 入参为[m*n]位于m行和n列中矩阵值, 矩阵是行优先的。 | + + +## CustomBuilder8+ + +组件属性方法参数可使用CustomBuilder类型来自定义UI描述。 + +| 名称 | 类型定义 | 描述 | +| ------------- | ---------------------- | ---------------------------------------- | +| CustomBuilder | () => any | 这种方法类型必须使用@Builder装饰器修饰。具体用法见[@Builder](ts-component-based-builder.md)。 | + diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md index 0986e03f2b635f689bd5a699c095e34079edefb3..16adaa56c33207d1a2eba09c6664785fb2dc0d28 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md @@ -12,10 +12,10 @@ | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| backgroundColor | [ResourceColor](../../ui/ts-types.md) | 设置组件的背景色。 | -| backgroundImage | - src: [ResourceStr](../../ui/ts-types.md),
- repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | src:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。
repeat:设置背景图片的重复样式,默认不重复。 | -| backgroundImageSize | {
width?: [Length](../../ui/ts-types.md#length),
height?: [Length](../../ui/ts-types.md#length)
} \| [ImageSize](ts-appendix-enums.md#imagesize) | 设置背景图像的高度和宽度。当输入为{width: Length, height: Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。
默认值:ImageSize.Auto | -| backgroundImagePosition | {
x?: [Length](../../ui/ts-types.md#length),
y?: [Length](../../ui/ts-types.md#length)
} \| [Alignment](ts-appendix-enums.md#alignment) | 设置背景图在组件中显示位置。
默认值:
{
x: 0,
y: 0
} | +| backgroundColor | [ResourceColor](ts-types.md) | 设置组件的背景色。 | +| backgroundImage | - src: [ResourceStr](ts-types.md),
- repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | src:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。
repeat:设置背景图片的重复样式,默认不重复。 | +| backgroundImageSize | {
width?: [Length](ts-types.md#length),
height?: [Length](ts-types.md#length)
} \| [ImageSize](ts-appendix-enums.md#imagesize) | 设置背景图像的高度和宽度。当输入为{width: Length, height: Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。
默认值:ImageSize.Auto | +| backgroundImagePosition | {
x?: [Length](ts-types.md#length),
y?: [Length](ts-types.md#length)
} \| [Alignment](ts-appendix-enums.md#alignment) | 设置背景图在组件中显示位置。
默认值:
{
x: 0,
y: 0
} | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md index 9d79e66d36821a40aeb9d9b7126808c9c99998fc..3292fda02a1f7e839a281339f23bf08cc62cc688 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md @@ -12,10 +12,10 @@ | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| source | string \| [Resource](../../ui/ts-types.md#resource类型) \| [linearGradient](ts-universal-attributes-gradient-color.md) | 边框图源或者渐变色设置。 | -| slice | [Length](../../ui/ts-types.md#length)\| EdgeWidth | 设置图片边框切割宽度。
默认值:0 | -| width | [Length](../../ui/ts-types.md#length)\| EdgeWidth | 设置图片边框宽度。
默认值:0 | -| outset | [Length](../../ui/ts-types.md#length)\| EdgeWidth | 设置边框图片向外延伸距离。
默认值:0 | +| source | string \| [Resource](ts-types.md#resource类型) \| [linearGradient](ts-universal-attributes-gradient-color.md) | 边框图源或者渐变色设置。 | +| slice | [Length](ts-types.md#length)\| EdgeWidth | 设置图片边框切割宽度。
默认值:0 | +| width | [Length](ts-types.md#length)\| EdgeWidth | 设置图片边框宽度。
默认值:0 | +| outset | [Length](ts-types.md#length)\| EdgeWidth | 设置边框图片向外延伸距离。
默认值:0 | | RepeatMode | RepeatMode | 设置边框图片的重复方式。
默认值:RepeatMode.Stretch | | fill | boolean | 设置边框图片中心填充。
默认值:false | ## EdgeWidth枚举说明 @@ -26,10 +26,10 @@ | 名称 | 参数类型 | 必填 |描述 | | -------- | -------- |-------- |-------- | -| left | [Length](../../ui/ts-types.md#length) | 否 | 左侧距离参数。 | -| right | [Length](../../ui/ts-types.md#length) | 否 | 右侧距离参数。 | -| top | [Length](../../ui/ts-types.md#length) | 否 | 上侧距离参数。 | -| bottom | [Length](../../ui/ts-types.md#length) | 否 | 下侧距离参数。 | +| left | [Length](ts-types.md#length) | 否 | 左侧距离参数。 | +| right | [Length](ts-types.md#length) | 否 | 右侧距离参数。 | +| top | [Length](ts-types.md#length) | 否 | 上侧距离参数。 | +| bottom | [Length](ts-types.md#length) | 否 | 下侧距离参数。 | ## RepeatMode枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md index 3c830ec6f320f179419359787d4b42137d492fff..39f476affafdd2f261bec91dd4b26287cb74f6dc 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md @@ -14,11 +14,11 @@ | 名称 | 参数类型 | 描述 | | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| border | {
width?: [Length](../../ui/ts-types.md#长度类型) \| EdgeWidth9+,
color?:  [ResourceColor](../../ui/ts-types.md) \| EdgeColor9+,
radius?:  [Length](../../ui/ts-types.md#长度类型) \| BorderRadiuses9+,
style?: [BorderStyle](ts-appendix-enums.md#borderstyle) \| EdgeStyle9+
} | 统一边框样式设置接口。
- width:设置边框宽度。
- color:设置边框颜色。
- radius:设置边框圆角半径。
- style:设置边框样式。 | +| border | {
width?: [Length](ts-types.md#长度类型) \| EdgeWidth9+,
color?:  [ResourceColor](ts-types.md) \| EdgeColor9+,
radius?:  [Length](ts-types.md#长度类型) \| BorderRadiuses9+,
style?: [BorderStyle](ts-appendix-enums.md#borderstyle) \| EdgeStyle9+
} | 统一边框样式设置接口。
- width:设置边框宽度。
- color:设置边框颜色。
- radius:设置边框圆角半径。
- style:设置边框样式。 | | borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) \| EdgeStyle9+ | 设置元素的边框样式。
默认值:BorderStyle.Solid | -| borderWidth | [Length](../../ui/ts-types.md) \| EdgeWidth9+ | 设置元素的边框宽度。 | -| borderColor | [ResourceColor](../../ui/ts-types.md) \| EdgeColor9+ | 设置元素的边框颜色。 | -| borderRadius | [Length](../../ui/ts-types.md) \| BorderRadiuses9+ | 设置元素的边框圆角半径。 | +| borderWidth | [Length](ts-types.md) \| EdgeWidth9+ | 设置元素的边框宽度。 | +| borderColor | [ResourceColor](ts-types.md) \| EdgeColor9+ | 设置元素的边框颜色。 | +| borderRadius | [Length](ts-types.md) \| BorderRadiuses9+ | 设置元素的边框圆角半径。 | ## EdgeWidth9+对象说明 @@ -26,10 +26,10 @@ | 名称 | 参数类型 | 必填 | 描述 | | ------ | ------------------------------------- | ---- | -------------- | -| left | [Length](../../ui/ts-types.md#length) | 否 | 左侧边框宽度。 | -| right | [Length](../../ui/ts-types.md#length) | 否 | 右侧边框宽度。 | -| top | [Length](../../ui/ts-types.md#length) | 否 | 上侧边框宽度。 | -| bottom | [Length](../../ui/ts-types.md#length) | 否 | 下侧边框宽度。 | +| left | [Length](ts-types.md#length) | 否 | 左侧边框宽度。 | +| right | [Length](ts-types.md#length) | 否 | 右侧边框宽度。 | +| top | [Length](ts-types.md#length) | 否 | 上侧边框宽度。 | +| bottom | [Length](ts-types.md#length) | 否 | 下侧边框宽度。 | ## EdgeColor9+对象说明 @@ -37,10 +37,10 @@ | 名称 | 参数类型 | 必填 | 描述 | | ------ | ------------------------------------- | ---- | -------------- | -| left | [ResourceColor](../../ui/ts-types.md) | 否 | 左侧边框颜色。 | -| right | [ResourceColor](../../ui/ts-types.md) | 否 | 右侧边框颜色。 | -| top | [ResourceColor](../../ui/ts-types.md) | 否 | 上侧边框颜色。 | -| bottom | [ResourceColor](../../ui/ts-types.md) | 否 | 下侧边框颜色。 | +| left | [ResourceColor](ts-types.md) | 否 | 左侧边框颜色。 | +| right | [ResourceColor](ts-types.md) | 否 | 右侧边框颜色。 | +| top | [ResourceColor](ts-types.md) | 否 | 上侧边框颜色。 | +| bottom | [ResourceColor](ts-types.md) | 否 | 下侧边框颜色。 | ## BorderRadiuses9+对象说明 @@ -48,10 +48,10 @@ | 名称 | 参数类型 | 必填 | 描述 | | ----------- | ------------------------------------- | ---- | ---------------- | -| topLeft | [Length](../../ui/ts-types.md#length) | 否 | 左上角圆角半径。 | -| topRight | [Length](../../ui/ts-types.md#length) | 否 | 右上角圆角半径。 | -| bottomLeft | [Length](../../ui/ts-types.md#length) | 否 | 左下角圆角半径。 | -| bottomRight | [Length](../../ui/ts-types.md#length) | 否 | 右下角圆角半径。 | +| topLeft | [Length](ts-types.md#length) | 否 | 左上角圆角半径。 | +| topRight | [Length](ts-types.md#length) | 否 | 右上角圆角半径。 | +| bottomLeft | [Length](ts-types.md#length) | 否 | 左下角圆角半径。 | +| bottomRight | [Length](ts-types.md#length) | 否 | 右下角圆角半径。 | ## EdgeStyle9+对象说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md index 564c3a50b6047ab2443719de2045030ed1513e45..69a874ba84308f42b672311959575cffadf31155 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md @@ -17,9 +17,9 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| linearGradient | {
angle?: number \| string,
direction?: [GradientDirection](ts-appendix-enums.md#gradientdirection),
colors: Array<[ColorStop](../../ui/ts-types.md)>
, repeating?: boolean
} | - | 线性渐变。
angle: 线性渐变的角度。
direction: 线性渐变的方向,设置angle后不生效。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | -| sweepGradient | {
center: Point,
start?: number \| string,
end?: number \| string,
colors: Array<[ColorStop](../../ui/ts-types.md)>
, repeating?: boolean
} | - | 角度渐变。
center:为角度渐变的中心点。
start:角度渐变的起点。
end:角度渐变的终点。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | -| radialGradient | {
center: Point,
radius: number \| string,
colors: Array<[ColorStop](../../ui/ts-types.md)>
, repeating: boolean
} | - | 径向渐变。
center:径向渐变的中心点。
radius:径向渐变的半径。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | +| linearGradient | {
angle?: number \| string,
direction?: [GradientDirection](ts-appendix-enums.md#gradientdirection),
colors: Array<[ColorStop](ts-types.md)>
, repeating?: boolean
} | - | 线性渐变。
angle: 线性渐变的角度。
direction: 线性渐变的方向,设置angle后不生效。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | +| sweepGradient | {
center: Point,
start?: number \| string,
end?: number \| string,
colors: Array<[ColorStop](ts-types.md)>
, repeating?: boolean
} | - | 角度渐变。
center:为角度渐变的中心点。
start:角度渐变的起点。
end:角度渐变的终点。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | +| radialGradient | {
center: Point,
radius: number \| string,
colors: Array<[ColorStop](ts-types.md)>
, repeating: boolean
} | - | 径向渐变。
center:径向渐变的中心点。
radius:径向渐变的半径。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md index b301bcb2f3dda328ceb909b2d70bfe1f3e14f636..a58be16636b4a4f0e005b43b5ce32ff6129c9a0b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md @@ -18,13 +18,13 @@ | ----------------------------- | ------------------------------------------------------------ | ------ | ------------------------------------------------------------ | | blur | number | - | 为当前组件添加内容模糊效果,入参为模糊半径,模糊半径越大越模糊,为0时不模糊。 | | backdropBlur | number | - | 为当前组件添加背景模糊效果,入参为模糊半径,模糊半径越大越模糊,为0时不模糊。 | -| shadow | {
radius: number \| [Resource](../../ui/ts-types.md#resource),
color?: Color \| string \| Resource,
offsetX?: number \| Resource,
offsetY?: number \| Resource
} | - | 为当前组件添加阴影效果,入参为模糊半径(必填)、阴影的颜色(可选,默认为灰色)、X轴的偏移量(可选,默认为0),Y轴的偏移量(可选,默认为0),偏移量单位为px。 | +| shadow | {
radius: number \| [Resource](ts-types.md#resource),
color?: Color \| string \| Resource,
offsetX?: number \| Resource,
offsetY?: number \| Resource
} | - | 为当前组件添加阴影效果,入参为模糊半径(必填)、阴影的颜色(可选,默认为灰色)、X轴的偏移量(可选,默认为0),Y轴的偏移量(可选,默认为0),偏移量单位为px。 | | grayscale | number | 0.0 | 为当前组件添加灰度效果。值定义为灰度转换的比例,入参1.0则完全转为灰度图像,入参则0.0图像无变化,入参在0.0和1.0之间时,效果呈线性变化。(百分比) | | brightness | number | 1.0 | 为当前组件添加高光效果,入参为高光比例,值为1时没有效果,小于1时亮度变暗,0为全黑;大于1时亮度增加,数值越大亮度越大。 | | saturate | number | 1.0 | 为当前组件添加饱和度效果,饱和度为颜色中的含色成分和消色成分(灰)的比例,入参为1时,显示原图像,大于1时含色成分越大,饱和度越大;小于1时消色成分越大,饱和度越小。(百分比) | | contrast | number | 1.0 | 为当前组件添加对比度效果,入参为对比度的值,值为1时,显示原图;大于1时,值越大对比度越高,图像越清晰醒目;小于1时,值越小对比度越低;当对比度为0时,图像变为全灰。(百分比) | | invert | number | 0 | 反转输入的图像。入参为图像反转的比例。值为1时完全反转。值为0则图像无变化。(百分比) | -| colorBlend 8+ | Color \| string \| [Resource](../../ui/ts-types.md#resource) | - | 为当前组件添加颜色叠加效果,入参为叠加的颜色。 | +| colorBlend 8+ | Color \| string \| [Resource](ts-types.md#resource) | - | 为当前组件添加颜色叠加效果,入参为叠加的颜色。 | | sepia | number | 0 | 将图像转换为深褐色。入参为图像反转的比例。值为1则完全是深褐色的,值为0图像无变化。 (百分比) | | hueRotate | number\|string | '0deg' | 色相旋转效果,输入参数为旋转角度。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md index 739ce3e872594c160bd0aee9f52da360cb9960ad..f071d455be691b5bf006f8641a5e33507202e45d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md @@ -14,9 +14,9 @@ | -------- | -------- | -------- | | align | [Alignment](ts-appendix-enums.md#alignment) | 设置元素内容的对齐方式,只有当设置的width和height大小超过元素本身内容大小时生效。
默认值:Alignment.Center | | direction | [Direction](ts-appendix-enums.md#direction) | 设置元素水平方向的布局。
默认值:Direction.Auto | -| position | {
x: [Length](../../ui/ts-types.md#length),
y: [Length](../../ui/ts-types.md#length)
} | 使用绝对定位,设置元素锚点相对于父容器顶部起点偏移位置。在布局容器中,设置该属性不影响父容器布局,仅在绘制时进行位置调整。 | -| markAnchor | {
x: [Length](../../ui/ts-types.md#length),
y: [Length](../../ui/ts-types.md#length)
} | 设置元素在位置定位时的锚点,以元素顶部起点作为基准点进行偏移。
默认值:
{
x: 0,
y: 1
} | -| offset | {
x: [Length](../../ui/ts-types.md#length),
y: [Length](../../ui/ts-types.md#length)
} | 相对布局完成位置坐标偏移量,设置该属性,不影响父容器布局,仅在绘制时进行位置调整。
默认值:
{
x: 0,
y: 1
} | +| position | {
x: [Length](ts-types.md#length),
y: [Length](ts-types.md#length)
} | 使用绝对定位,设置元素锚点相对于父容器顶部起点偏移位置。在布局容器中,设置该属性不影响父容器布局,仅在绘制时进行位置调整。 | +| markAnchor | {
x: [Length](ts-types.md#length),
y: [Length](ts-types.md#length)
} | 设置元素在位置定位时的锚点,以元素顶部起点作为基准点进行偏移。
默认值:
{
x: 0,
y: 1
} | +| offset | {
x: [Length](ts-types.md#length),
y: [Length](ts-types.md#length)
} | 相对布局完成位置坐标偏移量,设置该属性,不影响父容器布局,仅在绘制时进行位置调整。
默认值:
{
x: 0,
y: 1
} | | alignRules9+ | {
left?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
right?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
middle?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
top?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
bottom?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
center?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) }
} | 指定相对容器的对齐规则。
- left:设置左对齐参数。
- right:设置右对齐参数。
- middle:设置中间对齐的参数。
- top:设置顶部对齐的参数。
- bottom:设置底部对齐的参数。
- center:设置中心对齐的参数。
**说明:**
- anchor:设置作为锚点的组件的id值。
- align:设置相对于锚点组件的对齐方式。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md index a9e87d40133f5cf24eb3768d15ff7c584654f01a..1b46ee5137f7aec507f18951bb6a12963135066a 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md @@ -12,8 +12,8 @@ | 名称 | 参数类型 | 描述 | | ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| bindMenu | Array8+ | content: [CustomBuilder](../../ui/ts-types.md),
responseType: [ResponseType](ts-appendix-enums.md#responsetype8) | 给组件绑定菜单,触发方式为长按或者右键点击,弹出菜单项需要自定义。 | +| bindMenu | Array8+ | content: [CustomBuilder](ts-types.md),
responseType: [ResponseType](ts-appendix-enums.md#responsetype8) | 给组件绑定菜单,触发方式为长按或者右键点击,弹出菜单项需要自定义。 | ## MenuItem diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-opacity.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-opacity.md index aa285f3ccb765adc4c27712a8182b1838a6f2d8b..6fb486dcd3a95a4a09db971c42981e1509593844 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-opacity.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-opacity.md @@ -17,7 +17,7 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| opacity | number \| [Resource](../../ui/ts-types.md#resource类型) | 1 | 元素的不透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。 | +| opacity | number \| [Resource](ts-types.md#resource类型) | 1 | 元素的不透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md index ba9251977c5df751622a77ea68a74cf015cf12e3..bb707e9be1b7e5b3d8aeedaf19ca344e5ad7f231 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md @@ -20,7 +20,7 @@ | -------- | -------- | -------- | -------- | | message | string | 是 | 弹窗信息内容。 | | placementOnTop | boolean | 否 | 是否在组件上方显示,默认值为false。 | -| arrowOffset9+ | [Length](../../ui/ts-types.md#length) | 否 | popup箭头在弹窗处的偏移。箭头在气泡上下方时,默认居左;箭头在气泡左右侧时,默认居上。 | +| arrowOffset9+ | [Length](ts-types.md#length) | 否 | popup箭头在弹窗处的偏移。箭头在气泡上下方时,默认居左;箭头在气泡左右侧时,默认居上。 | | primaryButton | {
value: string,
action: () => void
} | 否 | 第一个按钮。
value: 弹窗里主按钮的文本。
action: 点击主按钮的回调函数。 | | secondaryButton | {
value: string,
action: () => void
} | 否 | 第二个按钮。
value: 弹窗里辅助按钮的文本。
action: 点击辅助按钮的回调函数。 | | onStateChange | (event: { isVisible: boolean }) => void | 否 | 弹窗状态变化事件回调,参数isVisible为弹窗当前的显示状态。 | @@ -29,11 +29,11 @@ | 名称 | 类型 | 必填 | 描述 | | -------- | -------- | -------- | -------- | -| builder | [CustomBuilder](../../ui/ts-types.md) | 是 | 提示气泡内容的构造器。 | +| builder | [CustomBuilder](ts-types.md) | 是 | 提示气泡内容的构造器。 | | placement | [Placement](ts-appendix-enums.md#placement8) | 否 | 气泡组件优先显示的位置,当前位置显示不下时,会自动调整位置。
默认值:Placement.Bottom | -| arrowOffset9+ | [Length](../../ui/ts-types.md#length) | 否 | popup箭头在弹窗处的偏移。箭头在气泡上下方时,默认居左;箭头在气泡左右侧时,默认居上。 | -| maskColor | [ResourceColor](../../ui/ts-types.md) | 否 | 提示气泡遮障层的颜色。 | -| popupColor | [ResourceColor](../../ui/ts-types.md) | 否 | 提示气泡的颜色。 | +| arrowOffset9+ | [Length](ts-types.md#length) | 否 | popup箭头在弹窗处的偏移。箭头在气泡上下方时,默认居左;箭头在气泡左右侧时,默认居上。 | +| maskColor | [ResourceColor](ts-types.md) | 否 | 提示气泡遮障层的颜色。 | +| popupColor | [ResourceColor](ts-types.md) | 否 | 提示气泡的颜色。 | | enableArrow | boolean | 否 | 是否显示箭头。
从API Version 9开始,如果箭头所在方位侧的气泡长度不足以显示下箭头,则会默认不显示箭头。比如:placement设置为Left,但气泡高度小于箭头的宽度(32vp),则实际不会显示箭头。
默认值:true | | autoCancel | boolean | 否 | 页面有操作时,是否自动关闭气泡
默认值:true | | onStateChange | (event: { isVisible: boolean }) => void | 否 | 弹窗状态变化事件回调,参数为弹窗当前的显示状态。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md index 900ed973ab009749201d7b351eef5e4c58a04008..94a531a62ffe5fcd59ce30cb6d0dc4b63f79bb40 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md @@ -18,11 +18,11 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| fontColor | [ResourceColor](../../ui/ts-types.md) | - | 设置文本颜色。 | -| fontSize | Length \| [Resource](../../ui/ts-types.md#resource类型) | - | 设置文本尺寸,Length为number类型时,使用fp单位。 | +| fontColor | [ResourceColor](ts-types.md) | - | 设置文本颜色。 | +| fontSize | Length \| [Resource](ts-types.md#resource类型) | - | 设置文本尺寸,Length为number类型时,使用fp单位。 | | fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | FontStyle.Normal | 设置文本的字体样式。 | | fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | FontWeight.FontWeightNormal | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。
提供常用枚举值,参考:FontWeight枚举说明。 | -| fontFamily | string \| [Resource](../../ui/ts-types.md#resource类型) | - | 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial, sans-serif'。 | +| fontFamily | string \| [Resource](ts-types.md#resource类型) | - | 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial, sans-serif'。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-touch-target.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-touch-target.md index 5b585a65b09b163afc25758c9fa33cf10edc933d..c8121960143866c9ff82d6395778e91fc4e38c27 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-touch-target.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-touch-target.md @@ -18,10 +18,10 @@ ### Rectangle对象说明 | 名称 | 类型 | 必填 | 描述 | | -------- | -------- | -------- | -------- | -| x | [Length](../../ui/ts-types.md) | 否 | 触摸点相对于组件本身左边沿的X坐标。
默认值:0vp | -| y | [Length](../../ui/ts-types.md) | 否 | 触摸点相对于组件本身左边沿的Y坐标。
默认值:0vp | -| width | [Length](../../ui/ts-types.md) | 否 | 触摸热区范围的宽度。
默认值:100% | -| height | [Length](../../ui/ts-types.md) | 否 | 触摸热区范围的高度。
默认值:100% | +| x | [Length](ts-types.md) | 否 | 触摸点相对于组件本身左边沿的X坐标。
默认值:0vp | +| y | [Length](ts-types.md) | 否 | 触摸点相对于组件本身左边沿的Y坐标。
默认值:0vp | +| width | [Length](ts-types.md) | 否 | 触摸热区范围的宽度。
默认值:100% | +| height | [Length](ts-types.md) | 否 | 触摸热区范围的高度。
默认值:100% | > **说明:** > diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md index 361699d2968608ae2aef7dc3eb9a9831145d3a8c..fd3bdbfd3487b506731ebf1327c8aaf901cc6acd 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md @@ -15,7 +15,7 @@ | 名称 | 支持冒泡 | 功能描述 | | ---------------------------------------- | ---- | ---------------------------------------- | -| onAreaChange(event: (oldValue: Area, newValue: Area) => void) | 否 | 组件区域变化时触发该回调,Area类型描述见[Area](../../ui/ts-types.md#area8)。 | +| onAreaChange(event: (oldValue: Area, newValue: Area) => void) | 否 | 组件区域变化时触发该回调,Area类型描述见[Area](ts-types.md#area8)。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md index 25e644f73d8a6523b051bea972a7aeff328c7f82..e6ad83abb7786c64549103654b6848754654b878 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md @@ -26,7 +26,7 @@ ## EventTarget8+对象说明 | 名称 | 参数类型 | 描述 | | ---- | ----------------- | ---------- | -| area | [Area](../../ui/ts-types.md#area8) | 目标元素的区域信息。 | +| area | [Area](ts-types.md#area8) | 目标元素的区域信息。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md index 4d6b2525e46f9cf5f1b716cfbb645a2cab61867d..646fee2de66c7cb9a00ebe2b08437e4ede77b088 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md @@ -9,7 +9,7 @@ | 名称 | 支持冒泡 | 功能描述 | | ---------------------------------------- | ---- | ---------------------------------------- | -| onDragStart(event: (event?: DragEvent, extraParams?: string) =>  [CustomBuilder](../../ui/ts-types.md#custombuilder8)) \| DragItemInfo | 否 | 第一次拖拽此事件绑定的组件时,触发回调。
- event:拖拽事件信息,包括拖拽点坐标。
- extraParams:拖拽事件额外信息,详见extraParam类型描述。
返回值:当前跟手效果所拖拽的对象,用于显示拖拽时的提示组件。
长按150毫秒(ms)可触发拖拽事件。优先级:长按手势配置时间小于等于150毫秒(ms)时,长按手势优先触发,否则拖拽事件优先触发。 | +| onDragStart(event: (event?: DragEvent, extraParams?: string) =>  [CustomBuilder](ts-types.md#custombuilder8)) \| DragItemInfo | 否 | 第一次拖拽此事件绑定的组件时,触发回调。
- event:拖拽事件信息,包括拖拽点坐标。
- extraParams:拖拽事件额外信息,详见extraParam类型描述。
返回值:当前跟手效果所拖拽的对象,用于显示拖拽时的提示组件。
长按150毫秒(ms)可触发拖拽事件。优先级:长按手势配置时间小于等于150毫秒(ms)时,长按手势优先触发,否则拖拽事件优先触发。 | | onDragEnter(event: (event?: DragEvent, extraParams?: string) => void) | 否 | 拖拽进入组件范围内时,触发回调。
- event:拖拽事件信息,包括拖拽点坐标。
- extraParams:拖拽事件额外信息,详见extraParam类型描述。
当监听了onDrop事件时,此事件才有效。 | | onDragMove(event: (event?: DragEvent, extraParams?: string) => void) | 否 | 拖拽在组件范围内移动时,触发回调。
- event:拖拽事件信息,包括拖拽点坐标。
- extraParams:拖拽事件额外信息,详见extraParam类型描述。
当监听了onDrop事件时,此事件才有效。 | | onDragLeave(event: (event?: DragEvent, extraParams?: string) => void) | 否 | 拖拽离开组件范围内时,触发回调。
- event:拖拽事件信息,包括拖拽点坐标。
- extraParams:拖拽事件额外信息,详见extraParam类型描述。
当监听了onDrop事件时,此事件才有效。 | @@ -19,7 +19,7 @@ | 属性名称 | 属性类型 | 必填 | 描述 | | ------------- | ------ | ------- |--------------------------------- | | pixelMap | [PixelMap](../apis/js-apis-image.md#pixelmap7) | 否 | 设置拖拽过程中显示的图片。 | - | builder | [CustomBuilder](../../ui/ts-types.md#custombuilder8) | 否 | 使用自定义生成器进行绘图,如果设置了pixelMap,则忽略此值。 | + | builder | [CustomBuilder](ts-types.md#custombuilder8) | 否 | 使用自定义生成器进行绘图,如果设置了pixelMap,则忽略此值。 | | extraInfo | string | 否 | 拖拽项的描述。 | diff --git a/zh-cn/application-dev/reference/js-service-widget-ui/js-service-widget-common-atomic-layout.md b/zh-cn/application-dev/reference/js-service-widget-ui/js-service-widget-common-atomic-layout.md index 81d672704b3ea750ae1e07e67f8baa9903e0c996..87aef492b94a58c47ab36426b5fa502f9eb0134d 100644 --- a/zh-cn/application-dev/reference/js-service-widget-ui/js-service-widget-common-atomic-layout.md +++ b/zh-cn/application-dev/reference/js-service-widget-ui/js-service-widget-common-atomic-layout.md @@ -1,6 +1,6 @@ # 原子布局 -在屏幕形态和规格不同等情况下,布局效果需要实现自适应,因此系统提供了面向不同屏幕尺寸界面自适应适配的布局能力,称为原子布局。设计师可以考虑使用原子能力,定义元素在不同形态的尺寸界面上体现的自适应规则。开发者可以使用原子布局能力,快速实现让应用在多形态屏幕上有与设计效果相匹配的自适应效果。 +在屏幕形态和规格不同等情况下,布局效果需要实现自适应,因此系统提供了面向不同屏幕尺寸的自适应布局能力,称为原子布局。设计师可以考虑使用原子能力,定义元素在不同形态的尺寸界面上体现的自适应规则。开发者可以使用原子布局能力,快速实现让应用在多形态屏幕上有与设计效果相匹配的自适应效果。 > **说明:** @@ -12,24 +12,24 @@ 在非折行flex布局基础上,增加了显示优先级标记,可以调整组件内元素水平/垂直方向的显示优先级,根据当前组件容器的可用空间来显示内容。 -| 样式 | 类型 | 默认值 | 说明 | -| -------- | -------- | -------- | -------- | -| display-index | number | 0 | 适用于div等支持flex布局的容器组件中的子组件上,当容器组件在flex主轴上尺寸不足以显示全部内容时,按照display-index值从小到大的顺序进行隐藏,具有相同display-index值的组件同时隐藏,默认值为0,表示隐藏。 | +| 样式 | 类型 | 默认值 | 说明 | +| ------------- | ------ | ---- | ---------------------------------------- | +| display-index | number | 0 | 适用于div等支持flex布局的容器组件中的子组件上,当容器组件在flex主轴上尺寸不足以显示全部内容时,按照display-index值从小到大的顺序进行隐藏,具有相同display-index值的组件同时隐藏,默认值为0,表示隐藏。 | ## 占比能力 在非折行的flex布局中,定义了占比能力的组件,保证指定元素始终在容器的某一个比例空间中进行布局。 -| 样式 | 类型 | 默认值 | 说明 | -| -------- | -------- | -------- | -------- | -| flex-weight | number | - | 指明当前元素在flex主轴方向上尺寸权值,当且仅当容器组件中所有节点均设置此属性时生效,当前元素尺寸为: 容器主轴尺寸 \* 当前权值 / 所有子元素权值和。 | +| 样式 | 类型 | 默认值 | 说明 | +| ----------- | ------ | ---- | ---------------------------------------- | +| flex-weight | number | - | 指明当前元素在flex主轴方向上尺寸权值,当且仅当容器组件中所有节点均设置此属性时生效,当前元素尺寸为: 容器主轴尺寸 \* 当前权值 / 所有子元素权值和。 | ## 固定比例 定义了组件固定比例调整尺寸的能力。 -| 样式 | 类型 | 默认值 | 说明 | -| -------- | -------- | -------- | -------- | -| aspect-ratio | number | - |  接受任意大于0的浮点值,定义为该节点的宽度与高度比,设置该属性后,该元素尺寸宽高比按照此属性值进行调整。
 遵守最大值与最小值的限制。
 在flex布局中,主轴尺寸先进行调整,后根据该尺寸调整交叉轴。 | +| 样式 | 类型 | 默认值 | 说明 | +| ------------ | ------ | ---- | ---------------------------------------- | +| aspect-ratio | number | - |  接受任意大于0的浮点值,定义为该节点的宽度与高度比,设置该属性后,该元素尺寸宽高比按照此属性值进行调整。
 遵守最大值与最小值的限制。
 在flex布局中,主轴尺寸先进行调整,后根据该尺寸调整交叉轴。 | diff --git a/zh-cn/application-dev/ui/Readme-CN.md b/zh-cn/application-dev/ui/Readme-CN.md index f4876392b3cbd07103959dd697762a9bcf32df44..7bc13823db69b4e6281a09cd09e433ff997ef734 100755 --- a/zh-cn/application-dev/ui/Readme-CN.md +++ b/zh-cn/application-dev/ui/Readme-CN.md @@ -12,7 +12,6 @@ - [资源文件的分类](ui-ts-basic-resource-file-categories.md) - [资源访问](ts-resource-access.md) - [像素单位](ts-pixel-units.md) - - [类型定义](ts-types.md) - 声明式语法 - [描述规范使用说明](ts-syntax-intro.md) - 通用UI描述规范 diff --git a/zh-cn/application-dev/ui/ts-types.md b/zh-cn/application-dev/ui/ts-types.md deleted file mode 100644 index 39b84c43e101fed069a02a52519bb72813043a71..0000000000000000000000000000000000000000 --- a/zh-cn/application-dev/ui/ts-types.md +++ /dev/null @@ -1,217 +0,0 @@ -# 类型定义 - -## Resource - -资源引用类型,用于设置组件属性的值。 - -可以通过`$r`或者`$rawfile`创建Resource类型对象,不可以修改Resource中的各属性的值。 - -- `$r('belonging.type.name')` - - belonging:系统资源或者应用资源,相应的取值为'sys'和'app'; - - type:资源类型,支持'color'、'float'、'string'、'media'等; - - name:资源名称,在资源定义时确定。 - -- `$rawfile('filename')` - - filename:工程中resources/rawfile目录下的文件名称。 - -## Length - -长度类型,用于描述尺寸单位。 - -| 类型 | 说明 | -| -------- | ------------------------------------------------------------ | -| string | 需要显式指定像素单位,如'10px',也可设置百分比字符串,如'100%'。 | -| number | 默认单位vp。 | -| Resource | 使用引入资源的方式,引入系统资源或者应用资源中的尺寸。 | - -## ResourceStr8+ - -字符串类型,用于描述字符串入参可以使用的类型。 - -| 类型 | 说明 | -| -------- | --------------------------------------------------- | -| string | 字符串类型。 | -| Resource | 使用引入资源的方式,引入系统资源或者应用资源中的字符串。 | - -## Padding - -内边距类型,用于描述组件不同方向的内边距。 - - | 名称 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- |------------------------ | - | top | Length | 否 | 组件内元素距组件顶部的尺寸。 | - | right | Length | 否 | 组件内元素距组件右边界的尺寸。 | - | bottom | Length | 否 | 组件内元素距组件底部的尺寸。 | - | left | Length | 否 | 组件内元素距组件左边界的尺寸。 | - -## Margin - -外边距类型,用于描述组件不同方向的外边距。 - - | 名称 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- |------------------------ | - | top | Length | 否 | 组件外元素距组件顶部的尺寸。 | - | right | Length | 否 | 组件外元素距组件右边界的尺寸。 | - | bottom | Length | 否 | 组件外元素距组件底部的尺寸。 | - | left | Length | 否 | 组件外元素距组件左边界的尺寸。 | - -## EdgeWidths9+ - -边框宽度类型,用于描述组件边框不同方向的宽度。 - - | 名称 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- |--------------------- | - | top | Length | 否 | 组件上边框宽度。 | - | right | Length | 否 | 组件右边框宽度。 | - | bottom | Length | 否 | 组件下边框宽度。 | - | left | Length | 否 | 组件左边框宽度。 | - -## BorderRadiuses9+ - -圆角类型,用于描述组件边框圆角半径。 - - | 名称 | 类型 | 必填 | 说明 | - | ----------- | ------ | ---- |--------------------- | - | topLeft | Length | 否 | 组件左上角圆角半径。 | - | topRight | Length | 否 | 组件右上角圆角半径。 | - | bottomLeft | Length | 否 | 组件左下角圆角半径。 | - | bottomRight | Length | 否 | 组件右下角圆角半径。 | - -## EdgeColors9+ - -边框颜色,用于描述组件边框四条边的颜色。 - - | 名称 | 类型 | 必填 | 说明 | - | ------- | --------------- | ---- |--------------------- | - | top | ResourceColor | 否 | 组件上边框颜色。 | - | right | ResourceColor | 否 | 组件右边框颜色。 | - | bottom | ResourceColor | 否 | 组件下边框颜色。 | - | left | ResourceColor | 否 | 组件左边框颜色。 | - -## EdgeStyles9+ - -边框样式,用于描述组件边框四条边的样式。 - - | 名称 | 类型 | 必填 | 说明 | - | ------- | ------------- | ---- |--------------------- | - | top | BorderStyle | 否 | 组件上边框样式。 | - | right | BorderStyle | 否 | 组件右边框样式。 | - | bottom | BorderStyle | 否 | 组件下边框样式。 | - | left | BorderStyle | 否 | 组件左边框样式。 | - - -## Offset - -相对布局完成位置坐标偏移量。 - - | 名称 | 类型 | 必填 | 说明 | - | -------- | ------ | ---- |--------------------- | - | dx | Length | 是 | 水平方向偏移量。 | - | dy | Length | 是 | 竖直方向偏移量。 | - -## ResourceColor8+ - -颜色类型,用于描述资源颜色类型。 - -| 类型 | 说明 | -| -------- | ----------------------- | -| [Color](../reference/arkui-ts/ts-appendix-enums.md#color) | 颜色枚举值。 | -| number | HEX格式颜色。 | -| string | rgb或者rgba格式颜色。 | -| Resource | 使用引入资源的方式,引入系统资源或者应用资源中的颜色。 | - -## LengthConstrain - -长度约束,用于对组件最大、最小长度做限制。 - - | 名称 | 类型 | 必填 | 说明 | - | --------- | ------ | ---- |---------------- | - | minLength | Length | 是 | 组件最小长度。 | - | maxLength | Length | 是 | 组件最大长度。 | - - -## Font - -设置文本样式。 - -| 名称 | 类型 | 必填 | 说明 | -| ------ | ------------------------------ | ---- | ------------------------------------------------------------ | -| size | [Length](#length) | 否 | 设置文本尺寸,Length为number类型时,使用fp单位。 | -| weight | [FontWeight](../reference/arkui-ts/ts-appendix-enums.md#fontweight) \| number \| string | 否 | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。 | -| family | string \| [Resource](#resource) | 否 | 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial, sans-serif'。 | -| style | [FontStyle](../reference/arkui-ts/ts-appendix-enums.md#fontstyle) | 否 | 设置文本的字体样式。 | - -## Area8+ - -区域类型,用于存储元素所占区域信息 - -| 名称 | 类型 | 说明 | -| -------------- | -------- | ------------------------------------------------- | -| width | [Length](#length) | 目标元素的宽度,作为返回值时,类型为number,单位vp。 | -| height | [Length](#length) | 目标元素的高度,作为返回值时,类型为number,单位vp。 | -| position | [Position](#position8) | 目标元素左上角相对父元素左上角的位置。 | -| globalPosition | [Position](#position8) | 目标元素左上角相对页面左上角的位置。 | - - -## Position8+ - -位置类型,用于表示一个坐标点。 - -| 名称 | 类型 | 必填 | 说明 | -| ----- | ------- | ---- | ------------------------------------------- | -| x | Length | 否 | x轴坐标,作为返回值时,类型为number,单位vp。 | -| y | Length | 否 | y轴坐标,作为返回值时,类型为number,单位vp。 | - -## ConstraintSizeOptions - -设置约束尺寸,组件布局时,进行尺寸范围限制。 - -| 名称 | 类型 | 必填 | 说明 | -| --------- | -------- | ---- | -------------- | -| minWidth | Length | 否 | 元素最小宽度。 | -| maxWidth | Length | 否 | 元素最大宽度。 | -| minHeight | Length | 否 | 元素最小高度。 | -| maxHeight | Length | 否 | 元素最大高度。 | - -## SizeOptions - -设置宽高尺寸。 - -| 名称 | 类型 | 必填 | 说明 | -| ------- | -------- | ---- | -------------- | -| width | Length | 否 | 元素宽度。 | -| height | Length | 否 | 元素高度。 | - - -## BorderOptions - -边框属性集合,用于描述边框相关信息。 - -| 名称 | 类型 | 必填 | 说明 | -| ------ | ----------------------- | ---- | ----------- | -| width | Length \| EdgeWidths9+ | 否 | 边框宽度。 | -| color | ResourceColor \| EdgeColors9+ | 否 | 边框颜色。 | -| radius | Length \| BorderRadiuses9+ | 否 | 边框圆角半径。 | -| style | [BorderStyle](../reference/arkui-ts/ts-appendix-enums.md#borderstyle) \| EdgeStyles9+ | 否 | 边框样式。 | - -## ColorFilter9+ - -创建具有4*5矩阵的颜色过滤器。 - -| 名称 | 类型 | 必填 | 描述 | -| ----------- | -------- | ------ | --------------------------------------------------------------- | -| constructor | number[] | 是 | 创建具有4*5矩阵的颜色过滤器, 入参为[m*n]位于m行和n列中矩阵值, 矩阵是行优先的。 | - - -## CustomBuilder8+ - -组件属性方法参数可使用CustomBuilder类型来自定义UI描述。 - -| 名称 | 类型定义 | 描述 | -| ------------- | ---------------------- | ------------------------------------------------------------ | -| CustomBuilder | () => any | 这种方法类型必须使用@Builder装饰器修饰。具体用法见[@Builder](ts-component-based-builder.md)。 | - diff --git a/zh-cn/application-dev/ui/ui-js-components-stepper.md b/zh-cn/application-dev/ui/ui-js-components-stepper.md index 6efaf995e06f4f94cce553c980f226c8ff9460ca..e85191d8534b7b53bb41d52c0593380ac8a9ee9d 100644 --- a/zh-cn/application-dev/ui/ui-js-components-stepper.md +++ b/zh-cn/application-dev/ui/ui-js-components-stepper.md @@ -268,12 +268,14 @@ export default { stepperChange(e){ console.log("stepperChange"+e.index) prompt.showToast({ + // index表示当前步骤的序号 message: 'Previous step: '+e.prevIndex+"-------Current step:"+e.index }) }, stepperNext(e){ console.log("stepperNext"+e.index) prompt.showToast({ + // pendingIndex表示将要跳转的序号 message: 'Current step:'+e.index+"-------Next step:"+e.pendingIndex }) var index = {pendingIndex:e.pendingIndex }