未验证 提交 4da2b223 编写于 作者: 潘钦旭 提交者: Gitee

Signed-off-by: panqinxu <panqinxu1@huawei.com>

上级 39b0b201
......@@ -17,19 +17,23 @@ import fileio from '@ohos.fileio';
使用该功能模块对文件/目录进行操作前,需要先获取其应用沙箱路径,获取方式及其接口用法请参考:
Stage模型
** Stage模型**
```js
import Ability from '@ohos.application.Ability'
import Ability from '@ohos.application.Ability';
class MainAbility extends Ability {
let path = '';
onWindowStageCreate(windowStage) {
let context = this.context;
let path = context.filesDir;
path = context.filesDir;
}
}
```
Stage模型context的具体获取方法参见[Stage模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-ability-context.md#abilitycontext)
FA模型
Stage模型context的具体获取方法参见[Stage模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-ability-context.md#abilitycontext)
** FA模型**
```js
import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
......@@ -38,7 +42,8 @@ FA模型
path = data;
})
```
FA模型context的具体获取方法参见[FA模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-Context.md#context%E6%A8%A1%E5%9D%97)
FA模型context的具体获取方法参见[FA模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-Context.md#context%E6%A8%A1%E5%9D%97)
## fileio.stat
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册