From 14cb1224fa9145307d9c695db112e4f5a8dab2f4 Mon Sep 17 00:00:00 2001 From: luoying_ace_admin Date: Sat, 24 Dec 2022 11:59:23 +0800 Subject: [PATCH] revise docs Signed-off-by: luoying_ace_admin --- .../reference/apis/js-apis-router.md | 58 +++++++++---------- .../ts-universal-attributes-location.md | 10 ++-- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-router.md b/zh-cn/application-dev/reference/apis/js-apis-router.md index caed182678..607bf89cf8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-router.md +++ b/zh-cn/application-dev/reference/apis/js-apis-router.md @@ -54,8 +54,8 @@ try { data1: 'message', data2: { data3: [123, 456, 789] - }, - }, + } + } }) .then(() => { // success @@ -103,8 +103,8 @@ try { data1: 'message', data2: { data3: [123, 456, 789] - }, - }, + } + } }, (err) => { if (err) { console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`); @@ -157,8 +157,8 @@ try { data1: 'message', data2: { data3: [123, 456, 789] - }, - }, + } + } }, router.RouterMode.Standard) .then(() => { // success @@ -207,8 +207,8 @@ try { data1: 'message', data2: { data3: [123, 456, 789] - }, - }, + } + } }, router.RouterMode.Standard, (err) => { if (err) { console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`); @@ -257,8 +257,8 @@ try { router.replaceUrl({ url: 'pages/detail', params: { - data1: 'message', - }, + data1: 'message' + } }) .then(() => { // success @@ -302,8 +302,8 @@ try { router.replaceUrl({ url: 'pages/detail', params: { - data1: 'message', - }, + data1: 'message' + } }, (err) => { if (err) { console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`); @@ -354,8 +354,8 @@ try { router.replaceUrl({ url: 'pages/detail', params: { - data1: 'message', - }, + data1: 'message' + } }, router.RouterMode.Standard) .then(() => { // success @@ -400,8 +400,8 @@ try { router.replaceUrl({ url: 'pages/detail', params: { - data1: 'message', - }, + data1: 'message' + } }, router.RouterMode.Standard, (err) => { if (err) { console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`); @@ -465,7 +465,7 @@ getLength(): string **示例:** ```js -var size = router.getLength(); +let size = router.getLength(); console.log('pages stack size = ' + size); ``` @@ -486,7 +486,7 @@ getState(): RouterState **示例:** ```js -var page = router.getState(); +let page = router.getState(); console.log('current index = ' + page.index); console.log('current name = ' + page.name); console.log('current path = ' + page.path); @@ -618,8 +618,8 @@ export default { router.push({ url: 'pages/detail/detail', params: { - data1: 'message', - }, + data1: 'message' + } }); } } @@ -649,7 +649,7 @@ struct Index { text: '这是第一页的值', data: { array: [12, 45, 78] - }, + } } } try { @@ -741,8 +741,8 @@ router.push({ data1: 'message', data2: { data3: [123, 456, 789] - }, - }, + } + } }); ``` ## router.push(deprecated) @@ -772,8 +772,8 @@ router.push({ data1: 'message', data2: { data3: [123, 456, 789] - }, - }, + } + } },router.RouterMode.Standard); ``` @@ -799,8 +799,8 @@ replace(options: RouterOptions): void router.replace({ url: 'pages/detail', params: { - data1: 'message', - }, + data1: 'message' + } }); ``` @@ -827,8 +827,8 @@ replace(options: RouterOptions, mode: RouterMode): void router.replace({ url: 'pages/detail/detail', params: { - data1: 'message', - }, + data1: 'message' + } }, router.RouterMode.Standard); ``` diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md index 47ff618136..fe33e7e9bd 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md @@ -58,16 +58,16 @@ struct PositionExample1 { .direction(Direction.Ltr) // 父容器设置direction为Direction.Rtl,子元素从右到左排列 Row() { - Text('1').height(50).width('25%').fontSize(16).backgroundColor(0xF5DEB3) - Text('2').height(50).width('25%').fontSize(16).backgroundColor(0xD2B48C) - Text('3').height(50).width('25%').fontSize(16).backgroundColor(0xF5DEB3) - Text('4').height(50).width('25%').fontSize(16).backgroundColor(0xD2B48C) + Text('1').height(50).width('25%').fontSize(16).backgroundColor(0xF5DEB3).textAlign(TextAlign.End) + Text('2').height(50).width('25%').fontSize(16).backgroundColor(0xD2B48C).textAlign(TextAlign.End) + Text('3').height(50).width('25%').fontSize(16).backgroundColor(0xF5DEB3).textAlign(TextAlign.End) + Text('4').height(50).width('25%').fontSize(16).backgroundColor(0xD2B48C).textAlign(TextAlign.End) } .width('90%') .direction(Direction.Rtl) } } - .width('100%').margin({ top: 5 }).direction(Direction.Rtl) + .width('100%').margin({ top: 5 }) } } ``` -- GitLab