提交 ac6a699a 编写于 作者: L liuhui

fix: fix variable typo

Signed-off-by: Nliuhui <liuhui@ohos.com.cn>
上级 80db5b26
......@@ -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 variable in place
}
buildSpecial() // invalid: no function calls
Text(this.calcTextValue()) // this function call is ok.
......
......@@ -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 = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: indented with 4 spaces
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // OK: indented with 4 spaces
int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: aligned
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // OK: aligned
```
## <a name="c2-10"></a>Variable Assignment
......
......@@ -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 = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: indented with 4 spaces
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // Good: indented with 4 spaces
int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: The lines are aligned.
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // Good: The lines are aligned.
```
## <a name="c3-10"></a> Variable Assignment
......
......@@ -540,11 +540,11 @@ int result = reallyReallyLongVariableName1 + // Good: 加号留在行末
表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子
```c
int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: 4空格缩进
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // OK: 4空格缩进
int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: 保持对齐
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // OK: 保持对齐
```
## <a name="c2-10"></a>变量赋值
......
......@@ -428,11 +428,11 @@ int result = reallyReallyLongVariableName1 + // Good
表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子
```cpp
int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: 4空格缩进
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // Good: 4空格缩进
int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 +
longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: 保持对齐
int sum = longVariableName1 + longVariableName2 + longVariableName3 +
longVariableName4 + longVariableName5 + longVariableName6; // Good: 保持对齐
```
## <a name="c3-10"></a> 变量赋值
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册