From d27994a59151e7bad1f984795adccb30555a2bb8 Mon Sep 17 00:00:00 2001 From: chenhaiying Date: Mon, 5 Sep 2022 04:37:18 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AA=97=E5=8F=A3=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A4=BA=E4=BE=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenhaiying --- .../reference/apis/js-apis-window.md | 69 ++++++++++--------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-window.md b/zh-cn/application-dev/reference/apis/js-apis-window.md index dcf45fef05..9dcd1e448c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-window.md +++ b/zh-cn/application-dev/reference/apis/js-apis-window.md @@ -3329,11 +3329,12 @@ scale(scaleOptions: ScaleOptions): void **示例:** ```js -var obj : window.ScaleOptions; -obj.x = 2.0; -obj.y = 1.0; -obj.pivotX = 0.5; -obj.pivotY = 0.5; +var obj : window.ScaleOptions = { + x : 2.0, + y : 1.0, + pivotX = 0.5; + pivotY = 0.5; +} windowClass.scale(obj); ``` @@ -3356,12 +3357,13 @@ rotate(rotateOptions: RotateOptions): void **示例:** ```js -var obj : window.RotateOptions; -obj.x = 1.0; -obj.y = 1.0; -obj.z = 45.0; -obj.pivotX = 0.5; -obj.pivotY = 0.5; +var obj : window.RotateOptions = { + x : 1.0, + y : 1.0, + z : 45.0, + pivotX = 0.5; + pivotY = 0.5; +} windowClass.rotate(obj); ``` @@ -3384,10 +3386,11 @@ translate(translateOptions: TranslateOptions): void **示例:** ```js -var obj : window.TranslateOptions; -obj.x = 100.0; -obj.y = 0.0; -obj.z = 0.0; +var obj : window.TranslateOptions = { + x : 100.0, + y : 0.0, + z : 0.0 +} windowClass.translate(obj); ``` @@ -3421,10 +3424,11 @@ controller.animationForHidden = (context : window.TransitionContext) => { iterations: 1, // 播放次数 playMode: PlayMode.Normal, // 动画模式 }, () => { - var obj : window.TranslateOptions; - obj.x = 100.0; - obj.y = 0.0; - obj.z = 0.0; + var obj : window.TranslateOptions = { + x : 100.0, + y : 0.0, + z : 0.0 + } toWindow.translate(obj); // 设置动画过程中的属性转换 console.info('toWindow translate end'); } @@ -3951,10 +3955,11 @@ controller.animationForShown = (context : window.TransitionContext) => { iterations: 1, // 播放次数 playMode: PlayMode.Normal, // 动画模式 }, () => { - var obj : window.TranslateOptions; - obj.x = 100.0; - obj.y = 0.0; - obj.z = 0.0; + var obj : window.TranslateOptions = { + x : 100.0, + y : 0.0, + z : 0.0 + } toWindow.translate(obj); console.info('toWindow translate end'); } @@ -3998,10 +4003,11 @@ controller.animationForShown = (context : window.TransitionContext) => { iterations: 1, // 播放次数 playMode: PlayMode.Normal, // 动画模式 }, () => { - var obj : window.TranslateOptions; - obj.x = 100.0; - obj.y = 0.0; - obj.z = 0.0; + var obj : window.TranslateOptions = { + x : 100.0, + y : 0.0, + z : 0.0 + } toWindow.translate(obj); console.info('toWindow translate end'); } @@ -4039,10 +4045,11 @@ controller.animationForHidden = (context : window.TransitionContext) => { iterations: 1, // 播放次数 playMode: PlayMode.Normal, // 动画模式 }, () => { - var obj : window.TranslateOptions; - obj.x = 100.0; - obj.y = 0.0; - obj.z = 0.0; + var obj : window.TranslateOptions = { + x : 100.0, + y : 0.0, + z : 0.0 + } toWindow.translate(obj); console.info('toWindow translate end'); } -- GitLab