Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
dd13357b
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看板
未验证
提交
dd13357b
编写于
9月 02, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 02, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23696 Rectify the arkts syntax 3 on monthly
Merge pull request !23696 from 189******51/monthly_20230815
上级
55d53cc6
44c5b3f9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
28 deletion
+28
-28
zh-cn/application-dev/quick-start/arkts-extend.md
zh-cn/application-dev/quick-start/arkts-extend.md
+16
-16
zh-cn/application-dev/quick-start/arkts-observed-and-objectlink.md
...lication-dev/quick-start/arkts-observed-and-objectlink.md
+1
-1
zh-cn/application-dev/quick-start/arkts-prop.md
zh-cn/application-dev/quick-start/arkts-prop.md
+6
-6
zh-cn/application-dev/quick-start/arkts-rendering-control-best-practices.md
...dev/quick-start/arkts-rendering-control-best-practices.md
+5
-5
未找到文件。
zh-cn/application-dev/quick-start/arkts-extend.md
浏览文件 @
dd13357b
...
@@ -64,27 +64,27 @@
...
@@ -64,27 +64,27 @@
-
\@
Extend装饰的方法的参数可以为function,作为Event事件的句柄。
-
\@
Extend装饰的方法的参数可以为function,作为Event事件的句柄。
```
ts
```
ts
@
Extend
(
Text
)
function
makeMeClick
(
onClick
:
()
=>
void
)
{
@
Extend
(
Text
)
function
makeMeClick
(
onClick
:
()
=>
void
)
{
.
backgroundColor
(
Color
.
Blue
)
.
backgroundColor
(
Color
.
Blue
)
.
onClick
(
onClick
)
.
onClick
(
onClick
)
}
}
@
Entry
@
Entry
@
Component
@
Component
struct
FancyUse
{
struct
FancyUse
{
@
State
label
:
string
=
'
Hello World
'
;
@
State
label
:
string
=
'
Hello World
'
;
onClickHandler
()
{
onClickHandler
()
{
this
.
label
=
'
Hello ArkUI
'
;
this
.
label
=
'
Hello ArkUI
'
;
}
}
build
()
{
build
()
{
Row
({
space
:
10
})
{
Row
({
space
:
10
})
{
Text
(
`
${
this
.
label
}
`
)
Text
(
`
${
this
.
label
}
`
)
.
makeMeClick
(
this
.
onClickHandler
.
bind
(
this
))
.
makeMeClick
(
this
.
onClickHandler
)
}
}
}
}
}
}
```
```
-
\@
Extend的参数可以为
[
状态变量
](
arkts-state-management-overview.md
)
,当状态变量改变时,UI可以正常的被刷新渲染。
-
\@
Extend的参数可以为
[
状态变量
](
arkts-state-management-overview.md
)
,当状态变量改变时,UI可以正常的被刷新渲染。
...
...
zh-cn/application-dev/quick-start/arkts-observed-and-objectlink.md
浏览文件 @
dd13357b
...
@@ -346,7 +346,7 @@ struct ViewB {
...
@@ -346,7 +346,7 @@ struct ViewB {
(
item
:
ClassA
)
=>
{
(
item
:
ClassA
)
=>
{
ViewA
({
label
:
`#
${
item
.
id
}
`
,
a
:
item
})
ViewA
({
label
:
`#
${
item
.
id
}
`
,
a
:
item
})
},
},
(
item
:
ClassA
)
=>
item
.
id
.
toString
()
(
item
:
ClassA
)
:
string
=>
item
.
id
.
toString
()
)
)
// 使用@State装饰的数组的数组项初始化@ObjectLink,其中数组项是被@Observed装饰的ClassA的实例
// 使用@State装饰的数组的数组项初始化@ObjectLink,其中数组项是被@Observed装饰的ClassA的实例
ViewA
({
label
:
`ViewA this.arrA[first]`
,
a
:
this
.
arrA
[
0
]
})
ViewA
({
label
:
`ViewA this.arrA[first]`
,
a
:
this
.
arrA
[
0
]
})
...
...
zh-cn/application-dev/quick-start/arkts-prop.md
浏览文件 @
dd13357b
...
@@ -264,7 +264,7 @@ struct ParentComponent {
...
@@ -264,7 +264,7 @@ struct ParentComponent {
```
ts
```
ts
@
Component
@
Component
struct
Child
{
struct
Child
{
@
Prop
value
:
number
;
@
Prop
value
:
number
=
0
;
build
()
{
build
()
{
Text
(
`
${
this
.
value
}
`
)
Text
(
`
${
this
.
value
}
`
)
...
@@ -288,10 +288,10 @@ struct Index {
...
@@ -288,10 +288,10 @@ struct Index {
Divider
().
height
(
5
)
Divider
().
height
(
5
)
ForEach
(
this
.
arr
,
ForEach
(
this
.
arr
,
item
=>
{
(
item
:
void
)
=>
{
Child
({
value
:
item
})
Child
({
value
:
item
})
},
},
item
=>
item
.
toString
()
(
item
:
string
)
=>
item
.
toString
()
)
)
Text
(
'
replace entire arr
'
)
Text
(
'
replace entire arr
'
)
.
fontSize
(
50
)
.
fontSize
(
50
)
...
@@ -419,7 +419,7 @@ class Book {
...
@@ -419,7 +419,7 @@ class Book {
@
Component
@
Component
struct
ReaderComp
{
struct
ReaderComp
{
@
Prop
book
:
Book
;
@
Prop
book
:
Book
=
new
Book
()
;
build
()
{
build
()
{
Row
()
{
Row
()
{
...
@@ -442,10 +442,10 @@ struct Library {
...
@@ -442,10 +442,10 @@ struct Library {
ReaderComp
({
book
:
this
.
allBooks
[
2
]
})
ReaderComp
({
book
:
this
.
allBooks
[
2
]
})
Divider
()
Divider
()
Text
(
'
Books on loaan to a reader
'
)
Text
(
'
Books on loaan to a reader
'
)
ForEach
(
this
.
allBooks
,
book
=>
{
ForEach
(
this
.
allBooks
,
(
book
:
void
)
=>
{
ReaderComp
({
book
:
book
})
ReaderComp
({
book
:
book
})
},
},
book
=>
book
.
id
)
(
book
:
number
):
number
=>
book
.
id
)
Button
(
'
Add new
'
)
Button
(
'
Add new
'
)
.
onClick
(()
=>
{
.
onClick
(()
=>
{
this
.
allBooks
.
push
(
new
Book
(
"
The C++ Standard Library
"
,
512
));
this
.
allBooks
.
push
(
new
Book
(
"
The C++ Standard Library
"
,
512
));
...
...
zh-cn/application-dev/quick-start/arkts-rendering-control-best-practices.md
浏览文件 @
dd13357b
...
@@ -22,10 +22,10 @@ struct Index {
...
@@ -22,10 +22,10 @@ struct Index {
build
()
{
build
()
{
Column
()
{
Column
()
{
ForEach
(
this
.
arr
,
ForEach
(
this
.
arr
,
(
item
)
=>
{
(
item
:
void
)
=>
{
Text
(
`Item
${
item
}
`
)
Text
(
`Item
${
item
}
`
)
},
},
item
=>
item
.
toString
())
(
item
:
string
)
=>
item
.
toString
())
Text
(
'
Add arr element
'
)
Text
(
'
Add arr element
'
)
.
fontSize
(
20
)
.
fontSize
(
20
)
.
onClick
(()
=>
{
.
onClick
(()
=>
{
...
@@ -61,7 +61,7 @@ ForEach数据源更新时,数组项ID与原数组项ID重复不会重新创建
...
@@ -61,7 +61,7 @@ ForEach数据源更新时,数组项ID与原数组项ID重复不会重新创建
```
ts
```
ts
@
Component
@
Component
struct
Child
{
struct
Child
{
@
Prop
value
:
number
;
@
Prop
value
:
number
=
0
;
build
()
{
build
()
{
Text
(
`
${
this
.
value
}
`
)
Text
(
`
${
this
.
value
}
`
)
.
fontSize
(
50
)
.
fontSize
(
50
)
...
@@ -83,10 +83,10 @@ struct Index {
...
@@ -83,10 +83,10 @@ struct Index {
Child
({
value
:
this
.
arr
[
2
]
})
Child
({
value
:
this
.
arr
[
2
]
})
Divider
().
height
(
5
)
Divider
().
height
(
5
)
ForEach
(
this
.
arr
,
ForEach
(
this
.
arr
,
item
=>
{
(
item
:
number
)
=>
{
Child
({
value
:
item
})
Child
({
value
:
item
})
},
},
item
=>
item
.
toString
()
// 键值,标识id
(
item
:
string
)
=>
item
.
toString
()
// 键值,标识id
)
)
Text
(
'
Parent: replace entire arr
'
)
Text
(
'
Parent: replace entire arr
'
)
.
fontSize
(
50
)
.
fontSize
(
50
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录