Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ea590254
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
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看板
提交
ea590254
编写于
10月 25, 2022
作者:
M
matchzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
示例文档符号整改
Signed-off-by:
N
matchzhou
<
zhouqingfeng2@huawei.com
>
上级
1c73b150
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
40 addition
and
40 deletion
+40
-40
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textclock.md
...n-dev/reference/arkui-ts/ts-basic-components-textclock.md
+5
-5
zh-cn/application-dev/reference/arkui-ts/ts-container-badge.md
.../application-dev/reference/arkui-ts/ts-container-badge.md
+5
-5
zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md
...lication-dev/reference/arkui-ts/ts-container-navigator.md
+5
-5
zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md
zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-component-id.md
...eference/arkui-ts/ts-universal-attributes-component-id.md
+9
-9
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-layout-constraints.md
...ce/arkui-ts/ts-universal-attributes-layout-constraints.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md
...n-dev/reference/arkui-ts/ts-universal-attributes-popup.md
+1
-1
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-touch-target.md
...eference/arkui-ts/ts-universal-attributes-touch-target.md
+4
-4
zh-cn/application-dev/reference/arkui-ts/ts-universal-focus-event.md
...cation-dev/reference/arkui-ts/ts-universal-focus-event.md
+9
-9
未找到文件。
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textclock.md
浏览文件 @
ea590254
...
...
@@ -65,9 +65,9 @@ stop()
@
Entry
@
Component
struct
Second
{
@
State
accumulateTime
:
number
=
0
;
@
State
accumulateTime
:
number
=
0
// 导入对象
controller
:
TextClockController
=
new
TextClockController
()
;
controller
:
TextClockController
=
new
TextClockController
()
build
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
alignItems
:
ItemAlign
.
Center
,
justifyContent
:
FlexAlign
.
Center
})
{
Text
(
'
Current milliseconds is
'
+
this
.
accumulateTime
)
...
...
@@ -76,7 +76,7 @@ struct Second {
TextClock
({
timeZoneOffset
:
-
8
,
controller
:
this
.
controller
})
.
format
(
'
hms
'
)
.
onDateChange
((
value
:
number
)
=>
{
this
.
accumulateTime
=
value
;
this
.
accumulateTime
=
value
})
.
margin
(
20
)
.
fontSize
(
30
)
...
...
@@ -84,12 +84,12 @@ struct Second {
.
margin
({
bottom
:
10
})
.
onClick
(()
=>
{
// 启动文本时钟
this
.
controller
.
start
()
;
this
.
controller
.
start
()
})
Button
(
"
stop TextClock
"
)
.
onClick
(()
=>
{
// 停止文本时钟
this
.
controller
.
stop
()
;
this
.
controller
.
stop
()
})
}
.
width
(
'
100%
'
)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-container-badge.md
浏览文件 @
ea590254
...
...
@@ -61,8 +61,8 @@
@
Entry
@
Component
struct
BadgeExample
{
@
State
counts
:
number
=
1
;
@
State
message
:
string
=
'
new
'
;
@
State
counts
:
number
=
1
@
State
message
:
string
=
'
new
'
build
()
{
Column
()
{
...
...
@@ -77,7 +77,7 @@ struct BadgeExample {
})
{
Button
(
'
message
'
)
.
onClick
(()
=>
{
this
.
counts
++
;
this
.
counts
++
})
.
width
(
100
).
height
(
50
).
backgroundColor
(
0x317aff
)
}.
width
(
100
).
height
(
50
)
...
...
@@ -91,7 +91,7 @@ struct BadgeExample {
})
{
Button
(
'
message
'
)
.
onClick
(()
=>
{
this
.
counts
++
;
this
.
counts
++
})
.
width
(
100
).
height
(
50
).
backgroundColor
(
0x317aff
)
}.
width
(
100
).
height
(
50
)
...
...
@@ -106,7 +106,7 @@ struct BadgeExample {
})
{
Button
(
'
message
'
)
.
onClick
(()
=>
{
this
.
counts
++
;
this
.
counts
++
})
.
width
(
100
).
height
(
50
).
backgroundColor
(
0x317aff
)
}.
width
(
100
).
height
(
50
)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md
浏览文件 @
ea590254
...
...
@@ -49,21 +49,21 @@ Navigator(value?: {target: string, type?: NavigationType})
@
Entry
@
Component
struct
NavigatorExample
{
@
State
active
:
boolean
=
false
;
@
State
active
:
boolean
=
false
@
State
Text
:
object
=
{
name
:
'
news
'
}
build
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
alignItems
:
ItemAlign
.
Start
,
justifyContent
:
FlexAlign
.
SpaceBetween
})
{
Navigator
({
target
:
'
pages/container/navigator/Detail
'
,
type
:
NavigationType
.
Push
})
{
Text
(
'
Go to
'
+
this
.
Text
[
'
name
'
]
+
'
page
'
)
.
width
(
'
100%
'
).
textAlign
(
TextAlign
.
Center
)
.
width
(
'
100%
'
).
textAlign
(
TextAlign
.
Center
)
}.
params
({
text
:
this
.
Text
})
// 传参数到Detail页面
Navigator
()
{
Text
(
'
Back to previous page
'
).
width
(
'
100%
'
).
textAlign
(
TextAlign
.
Center
)
}.
active
(
this
.
active
)
.
onClick
(()
=>
{
this
.
active
=
true
;
this
.
active
=
true
})
}.
height
(
150
).
width
(
350
).
padding
(
35
)
}
...
...
@@ -78,7 +78,7 @@ import router from '@ohos.router'
@
Component
struct
DetailExample
{
// 接收Navigator.ets的传参
@
State
text
:
any
=
router
.
getParams
().
text
;
@
State
text
:
any
=
router
.
getParams
().
text
build
()
{
Flex
({
direction
:
FlexDirection
.
Column
,
alignItems
:
ItemAlign
.
Start
,
justifyContent
:
FlexAlign
.
SpaceBetween
})
{
...
...
@@ -87,7 +87,7 @@ struct DetailExample {
}
Text
(
'
This is
'
+
this
.
text
[
'
name
'
]
+
'
page
'
)
.
width
(
'
100%
'
).
textAlign
(
TextAlign
.
Center
)
.
width
(
'
100%
'
).
textAlign
(
TextAlign
.
Center
)
}
.
width
(
'
100%
'
).
height
(
200
).
padding
({
left
:
35
,
right
:
35
,
top
:
35
})
}
...
...
zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md
浏览文件 @
ea590254
...
...
@@ -49,7 +49,7 @@ struct Index {
.
bindContextMenu
(
this
.
MenuBuilder
,
ResponseType
.
LongPress
)
.
onDragStart
(()
=>
{
// 拖拽时关闭菜单
ContextMenu
.
close
()
;
ContextMenu
.
close
()
})
}
.
width
(
'
100%
'
)
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-component-id.md
浏览文件 @
ea590254
...
...
@@ -126,19 +126,19 @@ sendMouseEvent(event: MouseEvent): boolean
```
ts
// xxx.ets
class
Utils
{
static
rect_left
;
static
rect_top
;
static
rect_right
;
static
rect_bottom
;
static
rect_value
;
static
rect_left
static
rect_top
static
rect_right
static
rect_bottom
static
rect_value
//获取组件所占矩形区域坐标
static
getComponentRect
(
key
)
{
let
strJson
=
getInspectorByKey
(
key
)
;
let
obj
=
JSON
.
parse
(
strJson
)
;
console
.
info
(
"
[getInspectorByKey] current component obj is:
"
+
JSON
.
stringify
(
obj
))
;
let
strJson
=
getInspectorByKey
(
key
)
let
obj
=
JSON
.
parse
(
strJson
)
console
.
info
(
"
[getInspectorByKey] current component obj is:
"
+
JSON
.
stringify
(
obj
))
let
rectInfo
=
JSON
.
parse
(
'
[
'
+
obj
.
$rect
+
'
]
'
)
console
.
info
(
"
[getInspectorByKey] rectInfo is:
"
+
rectInfo
)
;
console
.
info
(
"
[getInspectorByKey] rectInfo is:
"
+
rectInfo
)
this
.
rect_left
=
JSON
.
parse
(
'
[
'
+
rectInfo
[
0
]
+
'
]
'
)[
0
]
this
.
rect_top
=
JSON
.
parse
(
'
[
'
+
rectInfo
[
0
]
+
'
]
'
)[
1
]
this
.
rect_right
=
JSON
.
parse
(
'
[
'
+
rectInfo
[
1
]
+
'
]
'
)[
0
]
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-layout-constraints.md
浏览文件 @
ea590254
...
...
@@ -22,7 +22,7 @@
@
Entry
@
Component
struct
AspectRatioExample
{
private
children
:
string
[]
=
[
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
,
'
6
'
]
;
private
children
:
string
[]
=
[
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
,
'
6
'
]
build
()
{
Column
({
space
:
20
})
{
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md
浏览文件 @
ea590254
...
...
@@ -84,7 +84,7 @@ struct PopupExample {
secondaryButton
:
{
value
:
'
cancel
'
,
action
:
()
=>
{
this
.
handlePopup
=
!
this
.
handlePopup
;
this
.
handlePopup
=
!
this
.
handlePopup
console
.
info
(
'
cancel Button click
'
)
}
},
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-touch-target.md
浏览文件 @
ea590254
...
...
@@ -40,7 +40,7 @@
@
Entry
@
Component
struct
TouchTargetExample
{
@
State
text
:
string
=
""
;
@
State
text
:
string
=
""
build
()
{
Column
({
space
:
20
})
{
...
...
@@ -49,7 +49,7 @@ struct TouchTargetExample {
Button
(
"
button1
"
)
.
responseRegion
({
x
:
0
,
y
:
0
,
width
:
'
50%
'
,
height
:
'
100%
'
})
.
onClick
(()
=>
{
this
.
text
=
'
button1 clicked
'
;
this
.
text
=
'
button1 clicked
'
})
// 热区宽度为按钮的一半,且右移一个按钮宽度,点击button2右侧左边,点击事件生效
...
...
@@ -57,14 +57,14 @@ struct TouchTargetExample {
Button
(
"
button2
"
)
.
responseRegion
({
x
:
'
100%
'
,
y
:
0
,
width
:
'
50%
'
,
height
:
'
100%
'
})
.
onClick
(()
=>
{
this
.
text
=
'
button2 clicked
'
;
this
.
text
=
'
button2 clicked
'
})
// 热区大小为整个按钮,且下移一个按钮高度,点击button3下方按钮大小区域,点击事件生效
Text
(
"
{x:0,y:'100%',width:'100%',height:'100%'}
"
)
Button
(
"
button3
"
)
.
responseRegion
({
x
:
0
,
y
:
'
100%
'
,
width
:
'
100%
'
,
height
:
'
100%
'
})
.
onClick
(()
=>
{
this
.
text
=
'
button3 clicked
'
;
this
.
text
=
'
button3 clicked
'
})
Text
(
this
.
text
).
margin
({
top
:
50
})
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-focus-event.md
浏览文件 @
ea590254
...
...
@@ -24,9 +24,9 @@
@
Entry
@
Component
struct
FocusEventExample
{
@
State
oneButtonColor
:
string
=
'
#FFC0CB
'
;
@
State
twoButtonColor
:
string
=
'
#87CEFA
'
;
@
State
threeButtonColor
:
string
=
'
#90EE90
'
;
@
State
oneButtonColor
:
string
=
'
#FFC0CB
'
@
State
twoButtonColor
:
string
=
'
#87CEFA
'
@
State
threeButtonColor
:
string
=
'
#90EE90
'
build
()
{
Column
({
space
:
20
})
{
...
...
@@ -38,10 +38,10 @@ struct FocusEventExample {
.
fontColor
(
Color
.
Black
)
.
focusable
(
true
)
.
onFocus
(()
=>
{
this
.
oneButtonColor
=
'
#FF0000
'
;
this
.
oneButtonColor
=
'
#FF0000
'
})
.
onBlur
(()
=>
{
this
.
oneButtonColor
=
'
#FFC0CB
'
;
this
.
oneButtonColor
=
'
#FFC0CB
'
})
Button
(
'
Second Button
'
)
.
backgroundColor
(
this
.
twoButtonColor
)
...
...
@@ -50,10 +50,10 @@ struct FocusEventExample {
.
fontColor
(
Color
.
Black
)
.
focusable
(
true
)
.
onFocus
(()
=>
{
this
.
twoButtonColor
=
'
#FF0000
'
;
this
.
twoButtonColor
=
'
#FF0000
'
})
.
onBlur
(()
=>
{
this
.
twoButtonColor
=
'
#87CEFA
'
;
this
.
twoButtonColor
=
'
#87CEFA
'
})
Button
(
'
Third Button
'
)
.
backgroundColor
(
this
.
threeButtonColor
)
...
...
@@ -62,10 +62,10 @@ struct FocusEventExample {
.
fontColor
(
Color
.
Black
)
.
focusable
(
true
)
.
onFocus
(()
=>
{
this
.
threeButtonColor
=
'
#FF0000
'
;
this
.
threeButtonColor
=
'
#FF0000
'
})
.
onBlur
(()
=>
{
this
.
threeButtonColor
=
'
#90EE90
'
;
this
.
threeButtonColor
=
'
#90EE90
'
})
}.
width
(
'
100%
'
).
margin
({
top
:
20
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录