From 1c2f0792e2ab8eae70d30e9ef894bcd04ccb9338 Mon Sep 17 00:00:00 2001 From: coollixin Date: Mon, 4 Sep 2023 15:01:06 +0800 Subject: [PATCH] =?UTF-8?q?arkts=E8=AF=AD=E6=B3=95=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: coollixin --- zh-cn/application-dev/napi/napi-guidelines.md | 2 +- .../application-dev/reference/apis/js-apis-deque.md | 4 ++-- .../application-dev/reference/apis/js-apis-logs.md | 13 ++++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/napi/napi-guidelines.md b/zh-cn/application-dev/napi/napi-guidelines.md index 6dbf776e8b..1c56a1bb60 100644 --- a/zh-cn/application-dev/napi/napi-guidelines.md +++ b/zh-cn/application-dev/napi/napi-guidelines.md @@ -139,7 +139,7 @@ struct Index { .fontWeight(FontWeight.Bold) .onClick(() => { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - let ret = entry.nativeCallArkTS((value)=>{return value * 2;}); + let ret: number = entry.nativeCallArkTS((value: number)=>{return value * 2;}); hilog.info(0x0000, 'testTag', 'Test NAPI nativeCallArkTS ret = %{public}d', ret); }) } diff --git a/zh-cn/application-dev/reference/apis/js-apis-deque.md b/zh-cn/application-dev/reference/apis/js-apis-deque.md index 1d7a42346d..c1ba75ed24 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-deque.md +++ b/zh-cn/application-dev/reference/apis/js-apis-deque.md @@ -80,8 +80,8 @@ insertFront(element: T): void ```ts class C1 { - name: string - age: string + name: string = "" + age: string = "" } let deque: Deque | C1> = new Deque(); deque.insertFront("a"); diff --git a/zh-cn/application-dev/reference/apis/js-apis-logs.md b/zh-cn/application-dev/reference/apis/js-apis-logs.md index c1d20b17e0..6e0f2bcdde 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-logs.md +++ b/zh-cn/application-dev/reference/apis/js-apis-logs.md @@ -254,7 +254,18 @@ dir(dir?: Object): void **示例:** ```js -let a = { foo: { bar: { baz: true } }}; +class bar { + baz: boolean = true; +} +let b: bar = {baz: true} +class foo{ + bar: bar = b; +} +let c: foo = {bar: b} +class c1{ + foo: foo = c; +} +let a: c1 = {foo: c} console.dir(a); // Object: {"foo":{"bar":{"baz":true}}} -- GitLab