From 9de2bfb760e2b0769f8f37f1dda0ad763b9f9651 Mon Sep 17 00:00:00 2001 From: xu-rui-w Date: Wed, 7 Sep 2022 15:44:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=8C=E6=9C=9F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xu-rui-w --- .../reference/apis/js-apis-image.md | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-image.md b/zh-cn/application-dev/reference/apis/js-apis-image.md index c7629322b0..33129ee1db 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-image.md +++ b/zh-cn/application-dev/reference/apis/js-apis-image.md @@ -2039,7 +2039,12 @@ dequeueImage(callback: AsyncCallback\): void **示例:** ```js -111 +creator.dequeueImage((err, img) => { + if (err) { + console.info('dequeueImage succeeded.'); + } + console.info('dequeueImage failed.')); +}); ``` ### dequeueImage9+ @@ -2059,7 +2064,11 @@ dequeueImage(): Promise\ **示例:** ```js -111 +creator.dequeueImage().then(img => { + console.info('dequeueImage succeeded.'); +}).catch(error => { + console.log('dequeueImage failed: ' + error); +}) ``` ### dequeueImage9+ @@ -2080,7 +2089,12 @@ queueImage(interface: Image, callback: AsyncCallback\): void **示例:** ```js -111 +creator.queueImage(img, (err) => { + if (err) { + console.info('dequeueImage failed: ' + err); + } + console.info('dequeueImage succeeded'); +}) ``` ### dequeueImage9+ @@ -2106,7 +2120,11 @@ queueImage(interface: Image): Promise\ **示例:** ```js -111 +creator.queueImage(img).then(() => { + console.info('dequeueImage succeeded.'); +}).catch(error => { + console.info('dequeueImage failed: ' + error); +}) ``` ### on9+ @@ -2127,7 +2145,12 @@ on(type: 'imageRelease', callback: AsyncCallback\): void **示例:** ```js -111 +creator.on('imageRelease', (err) => { + if (err) { + console.info('on faild' + err); + } + console.info('on succeeded'); +}) ``` ### release9+ @@ -2147,7 +2170,12 @@ release(callback: AsyncCallback\): void **示例:** ```js -111 +creator.release((err) => { + if (err) { + console.info('release failed: ' + err); + } + console.info('release succeeded'); +}); ``` ### release9+ @@ -2164,7 +2192,11 @@ release(): Promise\ **示例:** ```js -111 +creator.release().then(() => { + console.info('release succeeded'); +}).catch(error => { + console.info('release failed'); +}) ``` ## Image9+ -- GitLab