未验证 提交 6990ab16 编写于 作者: O openharmony_ci 提交者: Gitee

!4030 Context中使用area属性替代switchArea和getArea接口

Merge pull request !4030 from mingxihua/master
......@@ -29,6 +29,7 @@
| bundleCodeDir | string | 是 | 否 | 应用安装路径。 |
| distributedFilesDir | string | 是 | 否 | 应用的分布式文件路径。 |
| eventHub | [EventHub](js-apis-eventhub.md) | 是 | 否 | 事件中心信息。|
| area | [AreaMode](#areamode) | 是 | 是 | 文件分区。|
## Context.createBundleContext
......@@ -81,49 +82,6 @@ getApplicationContext(): Context;
```
## Context.switchArea
switchArea(mode: AreaMode): void;
切换需要访问的文件分区。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| mode | [AreaMode](#areamode) | 是 | 文件分区。 |
**示例:**
```js
var areaMode = 0;
this.context.switchArea(areaMode);
```
## Context.getArea()
getArea(): AreaMode;
获取文件分级信息,可以查看当前是处于哪个分区。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| [AreaMode](#areamode) | 文件分区。 |
**示例:**
```js
let mode = this.context.getArea();
```
## AreaMode
访问的文件分区,每个文件分区有对应自己的内容。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册