未验证 提交 e0c8c4e6 编写于 作者: Z zengyawen 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-medialibrary.md.

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 4771f9f8
......@@ -33,7 +33,8 @@ getMediaLibrary(context: Context): MediaLibrary
**示例:(从API Version 9开始)**
```ts
var media = mediaLibrary.getMediaLibrary(this.context);
const context = getContext(this);
let media = mediaLibrary.getMediaLibrary(context);
```
**示例:(API Version 8)**
......@@ -41,8 +42,8 @@ var media = mediaLibrary.getMediaLibrary(this.context);
```js
import featureAbility from '@ohos.ability.featureAbility';
var context = featureAbility.getContext()
var media = mediaLibrary.getMediaLibrary(context);
let context = featureAbility.getContext()
let media = mediaLibrary.getMediaLibrary(context);
```
## mediaLibrary.getMediaLibrary
......@@ -65,7 +66,7 @@ getMediaLibrary(): MediaLibrary
**示例:**
```js
var media = mediaLibrary.getMediaLibrary();
let media = mediaLibrary.getMediaLibrary();
```
## MediaLibrary
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册