Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
cf84857a
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看板
提交
cf84857a
编写于
10月 12, 2022
作者:
S
sienna1128
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
sienna1128
<
lixiaoyan45@huawei.com
>
上级
60672a1a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
57 addition
and
62 deletion
+57
-62
zh-cn/application-dev/reference/arkui-ts/figures/sidebarContainer1.gif
...tion-dev/reference/arkui-ts/figures/sidebarContainer1.gif
+0
-0
zh-cn/application-dev/reference/arkui-ts/figures/sidebarContainer2.gif
...tion-dev/reference/arkui-ts/figures/sidebarContainer2.gif
+0
-0
zh-cn/application-dev/reference/arkui-ts/figures/sidebarcontainer.png
...ation-dev/reference/arkui-ts/figures/sidebarcontainer.png
+0
-0
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md
...n-dev/reference/arkui-ts/ts-basic-components-scrollbar.md
+2
-2
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md
...tion-dev/reference/arkui-ts/ts-basic-components-select.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md
...-dev/reference/arkui-ts/ts-basic-components-textpicker.md
+3
-3
zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md
...pplication-dev/reference/arkui-ts/ts-container-refresh.md
+6
-6
zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
...n-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
+30
-35
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-click.md
...n-dev/reference/arkui-ts/ts-universal-attributes-click.md
+4
-4
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md
...n-dev/reference/arkui-ts/ts-universal-attributes-popup.md
+10
-10
zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md
...ation-dev/reference/arkui-ts/ts-universal-events-click.md
+1
-1
未找到文件。
zh-cn/application-dev/reference/arkui-ts/figures/sidebarContainer1.gif
已删除
100644 → 0
浏览文件 @
60672a1a
228.7 KB
zh-cn/application-dev/reference/arkui-ts/figures/sidebarContainer2.gif
已删除
100644 → 0
浏览文件 @
60672a1a
174.5 KB
zh-cn/application-dev/reference/arkui-ts/figures/sidebarcontainer.png
0 → 100644
浏览文件 @
cf84857a
55.7 KB
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md
浏览文件 @
cf84857a
...
...
@@ -44,8 +44,8 @@ ScrollBar(value: { scroller: Scroller, direction?: ScrollBarDirection, state?: B
@
Entry
@
Component
struct
ScrollBarExample
{
private
scroller
:
Scroller
=
new
Scroller
()
;
private
arr
:
number
[]
=
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
;
private
scroller
:
Scroller
=
new
Scroller
()
private
arr
:
number
[]
=
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
build
()
{
Column
()
{
...
...
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md
浏览文件 @
cf84857a
...
...
@@ -61,7 +61,7 @@ struct SelectExample {
.
selectedOptionFont
({
size
:
40
,
weight
:
500
,
family
:
'
serif
'
,
style
:
FontStyle
.
Normal
})
.
optionFont
({
size
:
30
,
weight
:
400
,
family
:
'
serif
'
,
style
:
FontStyle
.
Normal
})
.
onSelect
((
index
:
number
)
=>
{
console
.
info
(
"
Select:
"
+
index
)
;
console
.
info
(
"
Select:
"
+
index
)
})
}
}
...
...
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textpicker.md
浏览文件 @
cf84857a
...
...
@@ -48,14 +48,14 @@ TextPicker(options?: {range: string[]|Resource, selected?: number, value?: strin
@
Entry
@
Component
struct
TextPickerExample
{
private
select
:
number
=
1
;
private
fruits
:
string
[]
=
[
'
apple1
'
,
'
orange2
'
,
'
peach3
'
,
'
grape4
'
]
;
private
select
:
number
=
1
private
fruits
:
string
[]
=
[
'
apple1
'
,
'
orange2
'
,
'
peach3
'
,
'
grape4
'
]
build
()
{
Column
()
{
TextPicker
({
range
:
this
.
fruits
,
selected
:
this
.
select
})
.
onChange
((
value
:
string
,
index
:
number
)
=>
{
console
.
info
(
'
Picker item changed, value:
'
+
value
+
'
, index:
'
+
index
)
;
console
.
info
(
'
Picker item changed, value:
'
+
value
+
'
, index:
'
+
index
)
})
}
}
...
...
zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md
浏览文件 @
cf84857a
...
...
@@ -50,8 +50,8 @@ Refresh\(value: \{ refreshing: boolean, offset?: number | string , fr
@
Entry
@
Component
struct
RefreshExample
{
@
State
isRefreshing
:
boolean
=
false
;
@
State
counter
:
number
=
0
;
@
State
isRefreshing
:
boolean
=
false
@
State
counter
:
number
=
0
build
()
{
Column
()
{
...
...
@@ -61,14 +61,14 @@ struct RefreshExample {
.
margin
(
10
)
}
.
onStateChange
((
refreshStatus
:
RefreshStatus
)
=>
{
console
.
info
(
'
Refresh onStatueChange state is
'
+
refreshStatus
)
;
console
.
info
(
'
Refresh onStatueChange state is
'
+
refreshStatus
)
})
.
onRefreshing
(()
=>
{
setTimeout
(()
=>
{
this
.
counter
++
;
this
.
isRefreshing
=
false
;
this
.
counter
++
this
.
isRefreshing
=
false
},
1000
)
console
.
log
(
'
onRefreshing test
'
)
;
console
.
log
(
'
onRefreshing test
'
)
})
}
}
...
...
zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
浏览文件 @
cf84857a
...
...
@@ -20,27 +20,27 @@ SideBarContainer( type?: SideBarContainerType )
| 参数名 | 参数类型 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- |
| type |
[
SideBarContainerType
](
#SideBarContainerType枚举说明
)
| 否 | 设置侧边栏的显示类型。
<br/>
默认值:SideBarContainerType.Embed |
| type |
SideBarContainerType
| 否 | 设置侧边栏的显示类型。
<br/>
默认值:SideBarContainerType.Embed |
## SideBarContainerType枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Embed | 侧边栏嵌入到组件内,和内容区并列显示。 |
| Overlay | 侧边栏
悬浮在内容区上面显示
。 |
| Overlay | 侧边栏
浮在内容区上面
。 |
## 属性
| 名称 | 参数类型 | 描述 |
| -------- | -------- | -------- |
| showSideBar | boolean | 设置是否显示侧边栏。
<br/>
默认值:
fals
e |
| controlButton |
[
ButtonStyle
](
#buttonstyle对象说明
)
| 设置侧边栏控制按钮的属性,包括定位,尺寸,图表等
。 |
| showSideBar | boolean | 设置是否显示侧边栏。
<br/>
默认值:
tru
e |
| controlButton |
ButtonStyle | 设置侧边栏控制按钮的属性
。 |
| showControlButton | boolean | 设置是否显示控制按钮。
<br/>
默认值:true |
| sideBarWidth | number
\|
[
Length
](
ts-types.md#length
)
| 设置侧边栏的宽度。
<br/>
默认值:200,单位vp |
| minSideBarWidth | number
\|
[
Length
](
ts-types.md#length
)
| 设置侧边栏最小宽度。
<br/>
默认值:200,单位vp |
| maxSideBarWidth | number
\|
[
Length
](
ts-types.md#length
)
| 设置侧边栏最大宽度。
<br/>
默认值:280,单位vp |
| sideBarWidth | number
\|
Length
<sup>
9+
</sup>
| 设置侧边栏的宽度。
<br/>
默认值:200,单位vp |
| minSideBarWidth | number
\|
Length
<sup>
9+
</sup>
| 设置侧边栏最小宽度。
<br/>
默认值:200,单位vp |
| maxSideBarWidth | number
\|
Length
<sup>
9+
</sup>
| 设置侧边栏最大宽度。
<br/>
默认值:280,单位vp |
| autoHide
<sup>
9+
</sup>
| boolean | 设置当侧边栏拖拽到小于最小宽度后,是否自动隐藏。
<br/>
默认值:true |
| sideBarPosition
<sup>
9+
</sup>
|
[
SideBarPosition
](
#sidebarposition9枚举说明
)
| 设置侧边栏显示位置。
<br/>
默认值:SideBarPosition.Start |
| sideBarPosition
<sup>
9+
</sup>
|
SideBarPosition
| 设置侧边栏显示位置。
<br/>
默认值:SideBarPosition.Start |
## ButtonStyle对象说明
...
...
@@ -59,6 +59,13 @@ SideBarContainer( type?: SideBarContainerType )
| Start | 侧边栏位于容器左侧。 |
| End | 侧边栏位于容器右侧。 |
## SideBarPosition<sup>9+</sup>枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Start | 侧边栏位于容器左侧。 |
| End | 侧边栏位于容器右侧。 |
## 事件
| 名称 | 功能描述 |
...
...
@@ -73,13 +80,14 @@ SideBarContainer( type?: SideBarContainerType )
@
Entry
@
Component
struct
SideBarContainerExample
{
normalIcon
:
Resource
=
$r
(
"
app.media.icon
"
);
selectedIcon
:
Resource
=
$r
(
"
app.media.icon
"
)
;
@
State
arr
:
number
[]
=
[
1
,
2
,
3
]
;
@
State
current
:
number
=
1
;
normalIcon
:
Resource
=
$r
(
"
app.media.icon
"
)
selectedIcon
:
Resource
=
$r
(
"
app.media.icon
"
)
@
State
arr
:
number
[]
=
[
1
,
2
,
3
]
@
State
current
:
number
=
1
build
()
{
SideBarContainer
(
SideBarContainerType
.
Embed
)
{
SideBarContainer
(
SideBarContainerType
.
Embed
)
{
Column
()
{
ForEach
(
this
.
arr
,
(
item
,
index
)
=>
{
Column
({
space
:
5
})
{
...
...
@@ -90,41 +98,28 @@ struct SideBarContainerExample {
.
fontFamily
(
'
source-sans-pro,cursive,sans-serif
'
)
}
.
onClick
(()
=>
{
this
.
current
=
item
;
this
.
current
=
item
})
},
item
=>
item
)
}.
width
(
'
100%
'
)
.
justifyContent
(
FlexAlign
.
SpaceEvenly
)
.
backgroundColor
(
'
#19000000
'
)
Column
()
{
Text
(
'
SideBarContainer content text.
'
).
fontSize
(
20
)
Text
(
'
SideBarContainer content text1
'
).
fontSize
(
25
)
Text
(
'
SideBarContainer content text2
'
).
fontSize
(
25
)
}
.
margin
({
top
:
50
,
left
:
20
,
right
:
30
})
}
.
showSideBar
(
true
)
// 显示侧边栏
.
controlButton
({
width
:
30
,
height
:
30
,
left
:
30
,
top
:
30
})
// 控制按钮属性
.
showControlButton
(
true
)
// 展示控制按钮
.
sideBarWidth
(
150
)
// 侧边栏宽度
.
minSideBarWidth
(
50
)
// 侧边栏最小宽度
.
maxSideBarWidth
(
300
)
//侧边栏最大宽度
.
autoHide
(
true
)
.
sideBarPosition
(
SideBarPosition
.
Start
)
//侧边栏位于容器左侧
.
sideBarWidth
(
150
)
.
minSideBarWidth
(
50
)
.
maxSideBarWidth
(
300
)
.
onChange
((
value
:
boolean
)
=>
{
console
.
info
(
'
status:
'
+
value
)
;
console
.
info
(
'
status:
'
+
value
)
})
}
}
```
SideBarContainerType为Embed效果如下:

SideBarContainerType为Ovelay时效果如下:


zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-click.md
浏览文件 @
cf84857a
...
...
@@ -22,22 +22,22 @@
@
Entry
@
Component
struct
TouchAbleExample
{
@
State
text1
:
string
=
''
;
@
State
text2
:
string
=
''
;
@
State
text1
:
string
=
''
@
State
text2
:
string
=
''
build
()
{
Stack
()
{
Rect
()
.
fill
(
Color
.
Gray
).
width
(
150
).
height
(
150
)
.
onClick
(()
=>
{
console
.
info
(
this
.
text1
=
'
Rect Clicked
'
)
;
console
.
info
(
this
.
text1
=
'
Rect Clicked
'
)
})
.
overlay
(
this
.
text1
,
{
align
:
Alignment
.
Bottom
,
offset
:
{
x
:
0
,
y
:
20
}
})
Ellipse
()
.
fill
(
Color
.
Pink
).
width
(
150
).
height
(
80
)
.
touchable
(
false
)
// 点击Ellipse区域,不会打印 “Ellipse Clicked”
.
onClick
(()
=>
{
console
.
info
(
this
.
text2
=
'
Ellipse Clicked
'
)
;
console
.
info
(
this
.
text2
=
'
Ellipse Clicked
'
)
})
.
overlay
(
this
.
text2
,
{
align
:
Alignment
.
Bottom
,
offset
:
{
x
:
0
,
y
:
20
}
})
}.
margin
(
100
)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md
浏览文件 @
cf84857a
...
...
@@ -47,8 +47,8 @@
@
Entry
@
Component
struct
PopupExample
{
@
State
handlePopup
:
boolean
=
false
;
@
State
customPopup
:
boolean
=
false
;
@
State
handlePopup
:
boolean
=
false
@
State
customPopup
:
boolean
=
false
// popup构造器定义弹框内容
@
Builder
popupBuilder
()
{
...
...
@@ -63,7 +63,7 @@ struct PopupExample {
// PopupOptions 类型设置弹框内容
Button
(
'
PopupOptions
'
)
.
onClick
(()
=>
{
this
.
handlePopup
=
!
this
.
handlePopup
;
this
.
handlePopup
=
!
this
.
handlePopup
})
.
bindPopup
(
this
.
handlePopup
,
{
message
:
'
This is a popup with PopupOptions
'
,
...
...
@@ -72,22 +72,22 @@ struct PopupExample {
primaryButton
:
{
value
:
'
confirm
'
,
action
:
()
=>
{
this
.
handlePopup
=
!
this
.
handlePopup
;
console
.
info
(
'
ok
Button click
'
)
this
.
handlePopup
=
!
this
.
handlePopup
console
.
info
(
'
confirm
Button click
'
)
}
},
// 第二个按钮
secondaryButton
:
{
value
:
'
canc
le
'
,
value
:
'
canc
el
'
,
action
:
()
=>
{
this
.
handlePopup
=
!
this
.
handlePopup
;
console
.
info
(
'
canc
le
Button click
'
)
console
.
info
(
'
canc
el
Button click
'
)
}
},
onStateChange
:
(
e
)
=>
{
console
.
info
(
e
.
isVisible
.
toString
())
if
(
!
e
.
isVisible
)
{
this
.
handlePopup
=
false
;
this
.
handlePopup
=
false
}
}
})
...
...
@@ -97,7 +97,7 @@ struct PopupExample {
// CustomPopupOptions 类型设置弹框内容
Button
(
'
CustomPopupOptions
'
)
.
onClick
(()
=>
{
this
.
customPopup
=
!
this
.
customPopup
;
this
.
customPopup
=
!
this
.
customPopup
})
.
bindPopup
(
this
.
customPopup
,
{
builder
:
this
.
popupBuilder
,
...
...
@@ -108,7 +108,7 @@ struct PopupExample {
showInSubWindow
:
false
,
onStateChange
:
(
e
)
=>
{
if
(
!
e
.
isVisible
)
{
this
.
customPopup
=
false
;
this
.
customPopup
=
false
}
}
})
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md
浏览文件 @
cf84857a
...
...
@@ -39,7 +39,7 @@
@
Entry
@
Component
struct
ClickExample
{
@
State
text
:
string
=
''
;
@
State
text
:
string
=
''
build
()
{
Column
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录