未验证 提交 a8c6f04f 编写于 作者: 耿文广 提交者: Gitee

update zh-cn/application-dev/quick-start/arkts-state.md.

Signed-off-by: N耿文广 <gengwenguang@huawei.com>
上级 95122c7d
...@@ -296,14 +296,14 @@ struct MyComponent { ...@@ -296,14 +296,14 @@ struct MyComponent {
2. 对于\@State来说,命名参数机制传递的值并不是必选的,如果没有命名参数传值,则使用本地初始化的默认值: 2. 对于\@State来说,命名参数机制传递的值并不是必选的,如果没有命名参数传值,则使用本地初始化的默认值:
```ts ```ts
class C1 { class C1 {
public count:number; public count:number;
public increaseBy:number; public increaseBy:number;
constructor(count: number, increaseBy:number) { constructor(count: number, increaseBy:number) {
this.count = count; this.count = count;
this.increaseBy = increaseBy; this.increaseBy = increaseBy;
} }
} }
let obj = new C1(1, 2) let obj = new C1(1, 2)
MyComponent(obj) MyComponent(obj)
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册