From 51f41898b419531b3dab25c7ef1841dcaf7e2572 Mon Sep 17 00:00:00 2001 From: yamila Date: Mon, 27 Mar 2023 15:43:21 +0800 Subject: [PATCH] Specification synchronization4 Signed-off-by: yamila --- .../ts-universal-attributes-background.md | 4 ++-- .../ts-universal-attributes-gradient-color.md | 6 ++--- .../ts-universal-attributes-image-effect.md | 22 +++++++++---------- .../arkui-ts/ts-universal-events-drag-drop.md | 6 ++--- 4 files changed, 19 insertions(+), 19 deletions(-) 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 d3ce69c6da..4107ebe46a 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 @@ -11,8 +11,8 @@ | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | | backgroundColor | [ResourceColor](ts-types.md#resourcecolor) | 设置组件的背景色。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| backgroundImage | src: [ResourceStr](ts-types.md#resourcestr),
repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | src:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。
repeat:设置背景图片的重复样式,默认不重复。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| 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
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| backgroundImage | src: [ResourceStr](ts-types.md#resourcestr),
repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | src:图片地址,支持网络图片资源地址和本地图片资源地址和Base64,不支持svg类型的图片。
repeat:设置背景图片的重复样式,默认不重复。当设置的背景图片为透明底色图片,且同时设置了backgroundColor时,二者叠加显示,背景颜色在最底部。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| backgroundImageSize | {
width?: [Length](ts-types.md#length),
height?: [Length](ts-types.md#length)
} \| [ImageSize](ts-appendix-enums.md#imagesize) | 设置背景图像的高度和宽度。当输入为{width: Length, height: Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。
width和height取值范围: [0, +∞)
默认值:ImageSize.Auto
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
设置为小于0的值时,按值为0显示。当设置了height未设置width时,width根据图片原始宽高比进行调整。 | | backgroundImagePosition | [Position](ts-types.md#position8) \| [Alignment](ts-appendix-enums.md#alignment) | 设置背景图在组件中显示位置,即相对于组件左上角的坐标。
默认值:
{
x: 0,
y: 0
}
x和y值设置百分比时,偏移量是相对组件自身宽高计算的。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | ## 示例 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 bd84c5ac35..bb90448db5 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 @@ -12,9 +12,9 @@ | 名称 | 参数类型 | 描述 | | -------------- | -------------------------------------------- | ----------------------------------- | -| linearGradient | {
angle?: number \| string,
direction?: [GradientDirection](ts-appendix-enums.md#gradientdirection),
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | 线性渐变。
- angle: 线性渐变的起始角度。0点方向顺时针旋转为正向角度。
默认值:180
- direction: 线性渐变的方向,设置angle后不生效。
默认值:GradientDirection.Bottom
- colors: 为渐变的颜色描述。
- repeating: 为渐变的颜色重复着色。
默认值:false
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| sweepGradient | {
center: Point,
start?: number \| string,
end?: number \| string,
rotation?: number\|string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | 角度渐变,仅绘制0-360度范围内的角度,超出时不绘制渐变色,只绘制纯色。
- center:为角度渐变的中心点,即相对于当前组件左上角的坐标。
- start:角度渐变的起点。
默认值:0
- end:角度渐变的终点。
默认值:0
- rotation: 角度渐变的旋转角度。
默认值:0
- colors: 为渐变的颜色描述。
- repeating: 为渐变的颜色重复着色。
默认值:false
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| radialGradient | {
center: Point,
radius: number \| string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | 径向渐变。
- center:径向渐变的中心点,即相对于当前组件左上角的坐标。
- radius:径向渐变的半径。
- colors: 为渐变的颜色描述。
- repeating: 为渐变的颜色重复着色。
默认值:false
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| linearGradient | {
angle?: number \| string,
direction?: [GradientDirection](ts-appendix-enums.md#gradientdirection),
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | 线性渐变。
- angle: 线性渐变的起始角度。0点方向顺时针旋转为正向角度。
默认值:180
- direction: 线性渐变的方向,设置angle后不生效。
默认值:GradientDirection.Bottom
- colors: 渐变的颜色描述。
- repeating: 为渐变的颜色重复着色。
默认值:false
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| sweepGradient | {
center: Point,
start?: number \| string,
end?: number \| string,
rotation?: number\|string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | 角度渐变,仅绘制0-360度范围内的角度,超出时不绘制渐变色,只绘制纯色。
- center:为角度渐变的中心点,即相对于当前组件左上角的坐标。
- start:角度渐变的起点。
 默认值:0
- end:角度渐变的终点。
 默认值:0
- rotation: 角度渐变的旋转角度。
 默认值:0
- colors: 为渐变的颜色描述。
- repeating: 为渐变的颜色重复着色。
默认值:false
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
设置为小于0的值时,按值为0处理,设置为大于360的值时,按值为360处理。
当start、end、rotation的数据类型为string,值为"90"或"90%",与90效果一致 | +| radialGradient | {
center: Point,
radius: number \| string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | 径向渐变。
- center:径向渐变的中心点,即相对于当前组件左上角的坐标。
- radius:径向渐变的半径。
 取值范围 [0,+∞)
  **说明:**
设置为小于的0值时,按值为0处理。
- colors: 为渐变的颜色描述。
- repeating: 为渐变的颜色重复着色。
默认值:false
从API version 9开始,该接口支持在ArkTS卡片中使用。 | ## 示例 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 36fbde66b1..a266635528 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 @@ -12,16 +12,16 @@ | 名称 | 参数类型 | 默认值 | 描述 | | ----------------------------- | ------------------------------------------------------------ | ------ | ------------------------------------------------------------ | -| blur | number | - | 为当前组件添加内容模糊效果,入参为模糊半径,模糊半径越大越模糊,为0时不模糊。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| backdropBlur | number | - | 为当前组件添加背景模糊效果,入参为模糊半径,模糊半径越大越模糊,为0时不模糊。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| blur | number | - | 为当前组件添加内容模糊效果,入参为模糊半径,模糊半径越大越模糊,为0时不模糊。
取值范围:[0, +∞)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| backdropBlur | number | - | 为当前组件添加背景模糊效果,入参为模糊半径,模糊半径越大越模糊,为0时不模糊。
取值范围:[0, +∞)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | shadow | [ShadowOptions](#shadowoptions对象说明) \| [ShadowStyle](#shadowstyle10枚举说明) | - | 为当前组件添加阴影效果。
入参类型为ShadowOptions时,可以指定模糊半径、阴影的颜色、X轴和Y轴的偏移量。
入参类型为ShadowStyle时,可指定不同阴影样式。
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
ArkTS卡片上不支持参数为 [ShadowStyle](#shadowstyle10枚举说明)类型。 | -| grayscale | number | 0.0 | 为当前组件添加灰度效果。值定义为灰度转换的比例,入参1.0则完全转为灰度图像,入参则0.0图像无变化,入参在0.0和1.0之间时,效果呈线性变化。(百分比)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| brightness | number | 1.0 | 为当前组件添加高光效果,入参为高光比例,值为1时没有效果,小于1时亮度变暗,0为全黑;大于1时亮度增加,数值越大亮度越大。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| saturate | number | 1.0 | 为当前组件添加饱和度效果,饱和度为颜色中的含色成分和消色成分(灰)的比例,入参为1时,显示原图像,大于1时含色成分越大,饱和度越大;小于1时消色成分越大,饱和度越小。(百分比)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| contrast | number | 1.0 | 为当前组件添加对比度效果,入参为对比度的值,值为1时,显示原图;大于1时,值越大对比度越高,图像越清晰醒目;小于1时,值越小对比度越低;当对比度为0时,图像变为全灰。(百分比)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| invert | number | 0 | 反转输入的图像。入参为图像反转的比例。值为1时完全反转。值为0则图像无变化。(百分比)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| sepia | number | 0 | 将图像转换为深褐色。入参为图像反转的比例。值为1则完全是深褐色的,值为0图像无变化。 (百分比)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| hueRotate | number \| string | '0deg' | 色相旋转效果,输入参数为旋转角度。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| grayscale | number | 0.0 | 为当前组件添加灰度效果。值定义为灰度转换的比例,入参1.0则完全转为灰度图像,入参则0.0图像无变化,入参在0.0和1.0之间时,效果呈线性变化。(百分比)
取值范围:[0, 1]
**说明:**
设置小于0的值时,按值为0处理,设置大于1的值时,按值为1处理。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| brightness | number | 1.0 | 为当前组件添加高光效果,入参为高光比例,值为1时没有效果,小于1时亮度变暗,0为全黑,大于1时亮度增加,数值越大亮度越大。
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按值为0处理。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| saturate | number | 1.0 | 为当前组件添加饱和度效果,饱和度为颜色中的含色成分和消色成分(灰)的比例,入参为1时,显示原图像,大于1时含色成分越大,饱和度越大,小于1时消色成分越大,饱和度越小。(百分比)
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按值为0处理。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| contrast | number | 1.0 | 为当前组件添加对比度效果,入参为对比度的值。值为1时,显示原图,大于1时,值越大对比度越高,图像越清晰醒目,小于1时,值越小对比度越低,当对比度为0时,图像变为全灰。(百分比)
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按值为0处理。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| invert | number | 0 | 反转输入的图像。入参为图像反转的比例,值为1时完全反转,值为0则图像无变化。(百分比)
取值范围:[0, 1]
**说明:**
设置小于0的值时,按值为0处理。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| sepia | number | 0 | 将图像转换为深褐色。入参为图像反转的比例,值为1则完全是深褐色的,值为0图像无变化。 (百分比)
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| hueRotate | number \| string | '0deg' | 色相旋转效果,输入参数为旋转角度。
取值范围:(-∞, +∞)
**说明:**
色调旋转360度会显示原始颜色。先将色调旋转180 度,然后再旋转-180度会显示原始颜色。数据类型为number时,值为90和'90deg'效果一致。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | colorBlend 8+ | [Color](ts-appendix-enums.md#color) \| string \| [Resource](ts-types.md#resource) | - | 为当前组件添加颜色叠加效果,入参为叠加的颜色。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | ## ShadowOptions对象说明 @@ -32,8 +32,8 @@ | 名称 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | --------------- | -| radius | number \| [Resource](ts-types.md#resource) | 是 | 阴影模糊半径。 | -| color | [Color](ts-appendix-enums.md#color) \| string \| [Resource](ts-types.md#resource) | 否 | 阴影的颜色。
默认为灰色。 | +| radius | number \| [Resource](ts-types.md#resource) | 是 | 阴影模糊半径。
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按值为0处理。 | +| color | [Color](ts-appendix-enums.md#color) \| string \| [Resource](ts-types.md#resource) | 否 | 阴影的颜色。
默认为黑色。 | | offsetX | number \| [Resource](ts-types.md#resource) | 否 | 阴影的X轴偏移量。
默认为0。 | | offsetY | number \| [Resource](ts-types.md#resource) | 否 | 阴影的Y轴偏移量。
默认为0。 | 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 36e78d99aa..39760592bf 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 @@ -67,7 +67,7 @@ struct DragExample { @State bananaVisible: Visibility = Visibility.Visible private dragList: string[] = ['apple', 'orange', 'banana'] @State fruitVisible: Visibility[] = [Visibility.Visible, Visibility.Visible, Visibility.Visible] - @State index: number = 0 + @State idx: number = 0 // 自定义拖拽过程中显示的内容 @Builder pixelMapBuilder() { @@ -104,7 +104,7 @@ struct DragExample { .onTouch((event: TouchEvent) => { if (event.type === TouchType.Down) { this.eventType = 'Down' - this.index = index + this.idx = index } if (event.type === TouchType.Up) { this.eventType = 'Up' @@ -157,7 +157,7 @@ struct DragExample { this.numbers.splice(jsonString.insertIndex, 0, this.text) this.bool = false } - this.fruitVisible[this.index] = Visibility.None + this.fruitVisible[this.idx] = Visibility.None }) }.width('100%').height('100%').padding({ top: 20 }).margin({ top: 20 }) } -- GitLab