未验证 提交 0049b44c 编写于 作者: O openharmony_ci 提交者: Gitee

!18607 增加FA模式下得pathDir获取

Merge pull request !18607 from lvyuanyuan/myfeature
......@@ -14,6 +14,8 @@ import fileuri from "@ohos.file.fileuri";
使用该功能模块前,需要先获取其应用沙箱路径,开发示例如下:
**Stage模型**
```js
import UIAbility from '@ohos.app.ability.UIAbility';
......@@ -25,6 +27,19 @@ export default class EntryAbility extends UIAbility {
}
```
**FA模型**
```js
import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
context.getFilesDir().then((data) => {
let pathDir = data;
})
```
FA模型context的具体获取方法参见[FA模型](js-apis-inner-app-context.md#Context模块)
## fileUri.getUriFromPath
getUriFromPath(path: string): string
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册