Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
04116714
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
04116714
编写于
7月 04, 2023
作者:
H
HelloCrease
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
HelloCrease
<
lian15@huawei.com
>
上级
8eff9132
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
70 addition
and
82 deletion
+70
-82
zh-cn/application-dev/quick-start/arkts-link.md
zh-cn/application-dev/quick-start/arkts-link.md
+1
-1
zh-cn/application-dev/quick-start/arkts-localstorage.md
zh-cn/application-dev/quick-start/arkts-localstorage.md
+2
-2
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image1_0000001184628104.png
...erence/arkui-ts/figures/zh-cn_image1_0000001184628104.png
+0
-0
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image2_0000001184628104.png
...erence/arkui-ts/figures/zh-cn_image2_0000001184628104.png
+0
-0
zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md
...application-dev/reference/arkui-ts/ts-container-swiper.md
+66
-66
zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md
zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md
+0
-3
zh-cn/application-dev/ui/ui-js-components-form.md
zh-cn/application-dev/ui/ui-js-components-form.md
+0
-4
zh-cn/application-dev/ui/ui-js-components-stepper.md
zh-cn/application-dev/ui/ui-js-components-stepper.md
+0
-4
zh-cn/application-dev/ui/ui-js-components-svg-overview.md
zh-cn/application-dev/ui/ui-js-components-svg-overview.md
+1
-2
未找到文件。
zh-cn/application-dev/quick-start/arkts-link.md
浏览文件 @
04116714
...
...
@@ -53,7 +53,7 @@
\@
Link装饰的变量和其所述的自定义组件共享生命周期。
为了了解
\@
Link变量初始化和更新机制,有必要先了解父组件和
和
拥有
\@
Link变量的子组件的关系,初始渲染和双向更新的流程(以父组件为
\@
State为例)。
为了了解
\@
Link变量初始化和更新机制,有必要先了解父组件和拥有
\@
Link变量的子组件的关系,初始渲染和双向更新的流程(以父组件为
\@
State为例)。
1.
初始渲染:执行父组件的build()函数后将创建子组件的新实例。初始化过程如下:
1.
必须指定父组件中的
\@
State变量,用于初始化子组件的
\@
Link变量。子组件的
\@
Link变量值与其父组件的数据源变量保持同步(双向数据同步)。
...
...
zh-cn/application-dev/quick-start/arkts-localstorage.md
浏览文件 @
04116714
...
...
@@ -9,7 +9,7 @@ LocalStorage是页面级的UI状态存储,通过\@Entry装饰器接受的参
> **说明:**
>
>
本模块
从API version 9开始支持。
>
LocalStorage
从API version 9开始支持。
## 概述
...
...
@@ -26,7 +26,7 @@ LocalStorage是ArkTS为构建页面级别状态变量提供存储的内存内“
应用程序决定LocalStorage对象的生命周期。当应用释放最后一个指向LocalStorage的引用时,比如销毁最后一个自定义组件,LocalStorage将被JS Engine垃圾回收。
LocalStorage根据与
\@
Component装饰的组件的
的
同步类型不同,提供了两个装饰器:
LocalStorage根据与
\@
Component装饰的组件的同步类型不同,提供了两个装饰器:
-
[
@LocalStorageProp
](
#localstorageprop
)
:
\@
LocalStorageProp装饰的变量和与LocalStorage中给定属性建立单行同步关系。
...
...
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image1_0000001184628104.png
已删除
100644 → 0
浏览文件 @
8eff9132
1.7 KB
zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image2_0000001184628104.png
已删除
100644 → 0
浏览文件 @
8eff9132
3.6 KB
zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md
浏览文件 @
04116714
...
...
@@ -32,7 +32,7 @@ Swiper(controller?: SwiperController)
除支持
[
通用属性
](
ts-universal-attributes-size.md
)
外,还支持以下属性,不支持
[
Menu控制
](
ts-universal-attributes-menu.md
)
。
| 名称 | 参数类型 | 描述 |
| --------------------------- | ---------------------------------------- | ---------------------------------------- |
| ---------------------------
----------
| ---------------------------------------- | ---------------------------------------- |
| index | number | 设置当前在容器中显示的子组件的索引值。
<br/>
默认值:0
<br/>
**说明:**
<br/>
设置小于0或大于等于子组件数量时,按照默认值0处理。
<br
/>
从API version 10开始,该属性支持
[
$$
](
../../quick-start/arkts-two-way-sync.md
)
双向绑定变量。 |
| autoPlay | boolean | 子组件是否自动播放。
<br/>
默认值:false
<br/>
**说明:**
<br/>
loop为false时,自动轮播到最后一页时停止轮播。手势切换后不是最后一页时继续播放。 |
| interval | number | 使用自动播放时播放的时间间隔,单位为毫秒。
<br/>
默认值:3000 |
...
...
@@ -45,7 +45,7 @@ Swiper(controller?: SwiperController)
| cachedCount
<sup>
8+
</sup>
| number | 设置预加载子组件个数。
<br/>
默认值:1
<br/>
**说明:**
<br/>
cachedCount只在Swiper使用
[
LazyForEach
](
../../quick-start/arkts-rendering-control-lazyforeach.md
)
时才生效。 |
| disableSwipe
<sup>
8+
</sup>
| boolean | 禁用组件滑动切换功能。
<br/>
默认值:false |
| curve
<sup>
8+
</sup>
|
[
Curve
](
ts-appendix-enums.md#curve
)
\|
string | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考
[
Curve枚举说明
](
ts-appendix-enums.md#curve
)
,也可以通过
[
插值计算
](
../apis/js-apis-curve.md
)
模块提供的接口创建自定义的插值曲线对象。
<br/>
默认值:Curve.Linear |
| indicatorStyle
<sup>
(deprecated)
</sup>
| {
<br/>
left?:
[Length](ts-types.md#length),
<br/>
top?:
[Length](ts-types.md#length),
<br/>
right?:
[Length](ts-types.md#length),
<br/>
bottom?:
[Length](ts-types.md#length),
<br/>
size?:
[Length](ts-types.md#length),
<br/>
mask?:
boolean,
<br/>
color?:
[ResourceColor](ts-types.md),
<br/>
selectedColor?:
[
ResourceColor
](
ts-types.md
)
<br/>
} | 设置导航点样式:
<br/>
\-
left: 设置导航点距离Swiper组件左边的距离。
<br/>
\-
top: 设置导航点距离Swiper组件顶部的距离。
<br/>
\-
right: 设置导航点距离Swiper组件右边的距离。
<br/>
\-
bottom: 设置导航点距离Swiper组件底部的距离。
<br/>
\-
size: 设置导航点的直径,不支持设置百分比。默认值:6vp。
<br/>
\-
mask: 设置是否显示导航点蒙层样式。
<br/>
\-
color: 设置导航点的颜色。
<br/>
\-
selectedColor: 设置选中的导航点的颜色。
<br/>
从API version 8开始支持,从API version 10开始不再维护,建议使用
[
indicator
](
#indicator10对象说明
)
代替。|
| indicatorStyle
<sup>
(deprecated)
</sup>
| {
<br/>
left?:
[Length](ts-types.md#length),
<br/>
top?:
[Length](ts-types.md#length),
<br/>
right?:
[Length](ts-types.md#length),
<br/>
bottom?:
[Length](ts-types.md#length),
<br/>
size?:
[Length](ts-types.md#length),
<br/>
mask?:
boolean,
<br/>
color?:
[ResourceColor](ts-types.md),
<br/>
selectedColor?:
[
ResourceColor
](
ts-types.md
)
<br/>
} | 设置导航点样式:
<br/>
\-
left: 设置导航点距离Swiper组件左边的距离。
<br/>
\-
top: 设置导航点距离Swiper组件顶部的距离。
<br/>
\-
right: 设置导航点距离Swiper组件右边的距离。
<br/>
\-
bottom: 设置导航点距离Swiper组件底部的距离。
<br/>
\-
size: 设置导航点的直径,不支持设置百分比。默认值:6vp。
<br/>
\-
mask: 设置是否显示导航点蒙层样式。
<br/>
\-
color: 设置导航点的颜色。
<br/>
\-
selectedColor: 设置选中的导航点的颜色。
<br/>
从API version 8开始支持,从API version 10开始不再维护,建议使用
[
indicator
](
#indicator10对象说明
)
代替。
|
| displayCount
<sup>
8+
</sup>
| number
\|
string | 设置一页内元素显示个数。
<br/>
默认值:1
<br/>
**说明:**
<br/>
字符串类型仅支持设置为'auto',显示效果同SwiperDisplayMode.AutoLinear。
<br/>
使用number类型且设置小于等于0时,按默认值1显示。
<br/>
使用number类型时,子组件按照主轴均分Swiper宽度(减去displayCount-1的itemSpace)的方式进行主轴拉伸(收缩)布局。 |
| effectMode
<sup>
8+
</sup>
|
[
EdgeEffect
](
ts-appendix-enums.md#edgeeffect
)
| 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。
<br/>
默认值:EdgeEffect.Spring
<br/>
**说明:**
<br/>
控制器接口调用时不生效回弹。 |
| displayArrow
<sup>
10+
</sup>
| value:
[
ArrowStyle
](
#arrowstyle10对象说明
)
\|
boolean,
<br/>
isHoverShow?: boolean | 设置导航点箭头样式。
<br/>
-value: 支持设置箭头和底板样式,异常场景使用ArrowStyle对象中的默认值。
<br/>
\-
isHoverShow:设置鼠标悬停时是否显示箭头。
<br/>
默认值:false
<br/>
**说明:**
<br/>
isHoverShow为false时,常驻显示箭头,支持点击翻页。
<br/>
isHoverShow为true时,只有在鼠标悬停时才会显示箭头,并支持点击翻页。 |
...
...
@@ -53,11 +53,11 @@ Swiper(controller?: SwiperController)
## SwiperDisplayMode枚举说明
| 名称 | 描述 |
| -----------
| --
---------------------------------------- |
| Stretch
<sup>
(deprecated)
</sup>
| Swiper滑动一页的宽度为Swiper组件自身的宽度。
<br>
从API verdion 10开始不再维护,建议使用STRETCH代替。
|
| AutoLinear
<sup>
(deprecated)
</sup>
| Swiper滑动一页的宽度为子组件宽度中的最大值。
<br>
从API verdion 10开始不再维护,建议使用AUTO_LINEAR代替。
|
| STRETCH
<sup>
10+
</sup>
| Swiper滑动一页的宽度为Swiper组件自身的宽度。
|
| AUTO_LINEAR
<sup>
10+
</sup>
| Swiper滑动一页的宽度为视窗内最左侧子组件的宽度。
|
| -----------
---------------------- |
---------------------------------------- |
| Stretch
<sup>
(deprecated)
</sup>
| Swiper滑动一页的宽度为Swiper组件自身的宽度。
<br>
从API verdion 10开始不再维护,建议使用STRETCH代替。
|
| AutoLinear
<sup>
(deprecated)
</sup>
| Swiper滑动一页的宽度为子组件宽度中的最大值。
<br>
从API verdion 10开始不再维护,建议使用AUTO_LINEAR代替。
|
| STRETCH
<sup>
10+
</sup>
| Swiper滑动一页的宽度为Swiper组件自身的宽度。
|
| AUTO_LINEAR
<sup>
10+
</sup>
| Swiper滑动一页的宽度为视窗内最左侧子组件的宽度。
|
## SwiperController
...
...
@@ -84,26 +84,26 @@ finishAnimation(callback?: () => void): void
**参数:**
| 参数名 | 参数类型 | 必填项 | 参数描述 |
| --------
- | ---------- | --
---- | -------- |
| --------
| ---------- |
---- | -------- |
| callback | () => void | 否 | 动画结束的回调。 |
## Indicator<sup>10+</sup>
对象说明
## Indicator<sup>10+</sup>
设置导航点距离Swiper组件距离。
| 参数名 | 参数类型 | 必填项 | 参数描述 |
| ------ | --------
| ------ |
------------------------------------ |
| ------ | --------
-------------------- | ---- | ----
------------------------------------ |
| left |
[
Length
](
ts-types.md#length
)
| 否 | 设置导航点距离Swiper组件左边的距离。
<br/>
默认值:0
<br/>
单位:vp |
| top |
[
Length
](
ts-types.md#length
)
| 否 | 设置导航点距离Swiper组件顶部的距离。
<br/>
默认值:0
<br/>
单位:vp |
| right |
[
Length
](
ts-types.md#length
)
| 否 | 设置导航点距离Swiper组件右边的距离。
<br/>
默认值:0
<br/>
单位:vp |
| bottom |
[
Length
](
ts-types.md#length
)
| 否 | 设置导航点距离Swiper组件底部的距离。
<br/>
默认值:0
<br/>
单位:vp |
##
# DotIndicator
##
DotIndicator<sup>10+</sup>
圆点指示器属性及功能继承自Indicator。
| 参数名 | 参数类型 | 必填项 | 参数描述 |
| ------------------ | -------------
| ------ | --------------
---------------------------------------- |
| ------------------ | -------------
--------------------------- | ---- |
---------------------------------------- |
| itemWidth |
[
Length
](
ts-types.md#length
)
| 否 | 设置Swiper组件圆点导航指示器的宽。
<br/>
默认值:6
<br/>
单位:vp |
| itemHeight |
[
Length
](
ts-types.md#length
)
| 否 | 设置Swiper组件圆点导航指示器的高。
<br/>
默认值:6
<br/>
单位:vp |
| selectedItemWidth |
[
Length
](
ts-types.md#length
)
| 否 | 设置选中Swiper组件圆点导航指示器的宽。
<br/>
默认值:6
<br/>
单位:vp |
...
...
@@ -112,24 +112,24 @@ finishAnimation(callback?: () => void): void
| color |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置Swiper组件圆点导航指示器的颜色。
<br/>
默认值:'
\#
182431'(10%透明度) |
| selectedColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置选中Swiper组件圆点导航指示器的颜色。
<br/>
默认值:'
\#
007DFF' |
##
# DigitIndicator
##
DigitIndicator<sup>10+</sup>
数字指示器属性及功能继承自Indicator。
| 参数名 | 参数类型 | 必填项 | 参数描述 |
| ----------------- | ----------------------------------------
-------------------- | ------ | --------------------
---------------------------------------- |
| ----------------- | ----------------------------------------
| ---- |
---------------------------------------- |
| fontColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置Swiper组件数字导航点的字体颜色。
<br/>
默认值:'
\#
ff182431' |
| selectedFontColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置选中Swiper组件数字导航点的字体颜色。
<br/>
默认值:'
\#
ff182431' |
| digitFont | {
<br/>
size?:
[
Length
](
ts-types.md#length
)
<br/>
weight?:number
\|
[
FontWeight
](
ts-appendix-enums.md#fontweight
)
\|
string
<br/>
} | 否 | 设置Swiper组件数字导航点的字体样式:
<br/>
\-
size:数字导航点指示器的字体大小。
<br/>
默认值:14vp
<br/>
\-
weight:数字导航点指示器的字重。 |
| selectedDigitFont | {
<br/>
size?:
[
Length
](
ts-types.md#length
)
<br/>
weight?:number
\|
[
FontWeight
](
ts-appendix-enums.md#fontweight
)
\|
string
<br/>
} | 否 | 设置选中Swiper组件数字导航点的字体样式:
<br/>
\-
size:数字导航点选中指示器的字体大小。
<br/>
默认值:14vp
<br/>
\-
weight:数字导航点选中指示器的字重。 |
##
# ArrowStyle<sup>10+</sup>对象说明
##
ArrowStyle<sup>10+</sup>
左右箭头属性。
| 参数名 | 参数类型 | 必填项 | 参数描述 |
| -------------
| -------- | ------ |
-------- |
| -------------
--- | ---------------------------------------- | ---- | --------------------------------
-------- |
| isShowBackground | boolean | 否 | 设置箭头底板是否显示。
<br/>
默认值:false |
| isSidebarMiddle
| boolean | 否 | 设置箭头显示位置。
<br/>
默认值:false
<br/>
默认显示在导航点指示器两侧。
|
| isSidebarMiddle
| boolean | 否 | 设置箭头显示位置。
<br/>
默认值:false
<br/>
默认显示在导航点指示器两侧。
|
| backgroundSize |
[
Length
](
ts-types.md#length
)
| 否 | 设置底板大小。
<br/>
在导航点两侧显示:
<br/>
默认值:24vp
<br/>
在组件两侧显示:
<br/>
默认值:32vp
<br/>
不支持设置百分比。 |
| backgroundColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置底板颜色。
<br/>
在导航点两侧显示:
<br/>
默认值:
\#
19182431
<br/>
在组件两侧显示:
<br/>
默认值:
\#
00000000 |
| arrowSize |
[
Length
](
ts-types.md#length
)
| 否 | 设置箭头大小。
<br/>
在导航点两侧显示时:
<br/>
默认值:18vp
<br/>
在组件两侧显示时:
<br/>
默认值:24vp
<br/>
**说明:**
<br/>
isShowBackground为true时,arrowSize为backgroundSize的3/4。
<br/>
不支持设置百分比。 |
...
...
@@ -142,7 +142,7 @@ finishAnimation(callback?: () => void): void
除支持
[
通用事件
](
ts-universal-events-click.md
)
外,还支持以下事件:
| 名称 | 功能描述 |
| ----------------------------------------
-------------------- | --------------------
---------------------------------------- |
| ----------------------------------------
|
---------------------------------------- |
| onChange(event: (index: number) => void) | 当前显示的子组件索引变化时触发该事件,返回值为当前显示的子组件的索引值。
<br/>
-
index:当前显示元素的索引。
<br/>
**说明:**
<br>
Swiper组件结合LazyForEach使用时,不能在onChange事件里触发子页面UI的刷新。 |
| onAnimationStart
<sup>
9+
</sup>
(event: (index: number) => void) | 切换动画开始时触发该回调。
<br/>
-
index:当前显示元素的索引。
<br/>
**说明:**
<br/>
参数为动画开始前的index值(不是最终结束动画的index值),多列Swiper时,index为最左侧组件的索引。 |
| onAnimationEnd
<sup>
9+
</sup>
(event: (index: number) => void) | 切换动画结束时触发该回调。
<br/>
-
index:当前显示元素的索引。
<br/>
**说明:**
<br/>
当Swiper切换动效结束时触发,包括动画过程中手势中断,通过SwiperController调用finishAnimatio。参数为动画结束后的index值,多列Swiper时,index为最左侧组件的索引。 |
...
...
zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md
浏览文件 @
04116714
...
...
@@ -3,9 +3,6 @@
通过设置插值器来实现动画效果。
> **说明:**
> 从API Version 6 开始支持。
## 创建动画对象
...
...
zh-cn/application-dev/ui/ui-js-components-form.md
浏览文件 @
04116714
...
...
@@ -3,10 +3,6 @@
form是一个表单容器,支持容器内
[
Input
](
../reference/arkui-js/js-components-basic-input.md
)
组件内容的提交和重置。具体用法请参考
[
form API
](
../reference/arkui-js/js-components-container-form.md
)
。
> **说明:**
> 从 API Version 6 开始支持。
## 创建form组件
在pages/index目录下的hml文件中创建一个form组件。
...
...
zh-cn/application-dev/ui/ui-js-components-stepper.md
浏览文件 @
04116714
...
...
@@ -3,10 +3,6 @@
当一个任务需要多个步骤时,可以使用stepper组件展示当前进展。具体用法请参考
[
stepper API
](
../reference/arkui-js/js-components-container-stepper.md
)
。
> **说明:**
> 从API Version 5 开始支持。
## 创建stepper组件
在pages/index目录下的hml文件中创建一个stepper组件。
...
...
zh-cn/application-dev/ui/ui-js-components-svg-overview.md
浏览文件 @
04116714
...
...
@@ -5,9 +5,8 @@ Svg组件主要作为svg画布的根节点使用,也可以在svg中嵌套使
> **说明:**
> - 从API version 7开始支持。
>
>
-
svg父组件或者svg组件需要定义宽高值,否则不进行绘制。
> svg父组件或者svg组件需要定义宽高值,否则不进行绘制。
## 创建Svg组件
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录