Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ac6a699a
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
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看板
提交
ac6a699a
编写于
5月 26, 2022
作者:
L
liuhui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix variable typo
Signed-off-by:
N
liuhui
<
liuhui@ohos.com.cn
>
上级
80db5b26
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
17 addition
and
17 deletion
+17
-17
en/application-dev/ui/ts-syntactic-sugar.md
en/application-dev/ui/ts-syntactic-sugar.md
+1
-1
en/contribute/OpenHarmony-c-coding-style-guide.md
en/contribute/OpenHarmony-c-coding-style-guide.md
+4
-4
en/contribute/OpenHarmony-cpp-coding-style-guide.md
en/contribute/OpenHarmony-cpp-coding-style-guide.md
+4
-4
zh-cn/contribute/OpenHarmony-c-coding-style-guide.md
zh-cn/contribute/OpenHarmony-c-coding-style-guide.md
+4
-4
zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md
zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md
+4
-4
未找到文件。
en/application-dev/ui/ts-syntactic-sugar.md
浏览文件 @
ac6a699a
...
...
@@ -130,7 +130,7 @@ build() {
let a: number = 1 // invalid: variable declaration not allowed
Column() {
Text('Hello ${this.myName.toUpperCase()}') // ok.
ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array varible in place
ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array vari
a
ble in place
}
buildSpecial() // invalid: no function calls
Text(this.calcTextValue()) // this function call is ok.
...
...
en/contribute/OpenHarmony-c-coding-style-guide.md
浏览文件 @
ac6a699a
...
...
@@ -577,11 +577,11 @@ int result = reallyReallyLongVariableName1 + // Good: The plus sign is placed
After an expression is wrapped, ensure that the lines are properly aligned or indented by 4 spaces. Example:
```
c
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// OK: indented with 4 spaces
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// OK: indented with 4 spaces
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// OK: aligned
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// OK: aligned
```
## <a name="c2-10"></a>Variable Assignment
...
...
en/contribute/OpenHarmony-cpp-coding-style-guide.md
浏览文件 @
ac6a699a
...
...
@@ -428,11 +428,11 @@ int result = reallyReallyLongVariableName1 + // Good
After an expression is wrapped, ensure that the lines are aligned appropriately or indented with 4 spaces. See the following example.
```
cpp
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// Good: indented with 4 spaces
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// Good: indented with 4 spaces
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// Good: The lines are aligned.
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// Good: The lines are aligned.
```
## <a name="c3-10"></a> Variable Assignment
...
...
zh-cn/contribute/OpenHarmony-c-coding-style-guide.md
浏览文件 @
ac6a699a
...
...
@@ -540,11 +540,11 @@ int result = reallyReallyLongVariableName1 + // Good: 加号留在行末
表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子
```
c
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// OK: 4空格缩进
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// OK: 4空格缩进
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// OK: 保持对齐
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// OK: 保持对齐
```
## <a name="c2-10"></a>变量赋值
...
...
zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md
浏览文件 @
ac6a699a
...
...
@@ -428,11 +428,11 @@ int result = reallyReallyLongVariableName1 + // Good
表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子
```
cpp
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// Good: 4空格缩进
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// Good: 4空格缩进
int
sum
=
longVari
bleName1
+
longVaribleName2
+
longVari
bleName3
+
longVari
bleName4
+
longVaribleName5
+
longVari
bleName6
;
// Good: 保持对齐
int
sum
=
longVari
ableName1
+
longVariableName2
+
longVaria
bleName3
+
longVari
ableName4
+
longVariableName5
+
longVaria
bleName6
;
// Good: 保持对齐
```
## <a name="c3-10"></a> 变量赋值
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录