未验证 提交 5c35f25c 编写于 作者: O openharmony_ci 提交者: Gitee

!2904 Done! 2517:修改display示例代码

Merge pull request !2904 from wusongqing/TR2517
...@@ -67,7 +67,7 @@ Obtains the default display object. ...@@ -67,7 +67,7 @@ Obtains the default display object.
``` ```
var displayClass = null; var displayClass = null;
display.getDefaultDisplay((err, data) => { display.getDefaultDisplay((err, data) => {
if (err) { if (err.code) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(err)); console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(err));
return; return;
} }
...@@ -119,7 +119,7 @@ Obtains all the display objects. ...@@ -119,7 +119,7 @@ Obtains all the display objects.
``` ```
display.getAllDisplay((err, data) => { display.getAllDisplay((err, data) => {
if (err) { if (err.code) {
console.error('Failed to obtain all the display objects. Code: ' + JSON.stringify(err)); console.error('Failed to obtain all the display objects. Code: ' + JSON.stringify(err));
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册