提交 46b58647 编写于 作者: W wusongqing

update docs against 8161

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 c97da578
...@@ -10,12 +10,11 @@ For details about the APIs, see [Display](../reference/apis/js-apis-display.md). ...@@ -10,12 +10,11 @@ For details about the APIs, see [Display](../reference/apis/js-apis-display.md).
## How to Develop ## How to Develop
Call **getDefaultDisplay(): Promise<Display>** to obtain the default display object. An example code snippet is as follows: Call `getDefaultDisplay(): Promise<Display>` to obtain the default display object. An example code snippet is as follows:
```js ```js
import display from '@ohos.display' // Import the module. import display from '@ohos.display' // Import the module.
let disp; // disp is used to save the default display object.
display.getDefaultDisplay().then((disp) => { display.getDefaultDisplay().then((disp) => {
console.log('display.getDefaultDisplay success, display :' + JSON.stringify(disp)); console.log('display.getDefaultDisplay success, display :' + JSON.stringify(disp));
}, (err) => { }, (err) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册