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

!3269 修复元能力接口资料示例代码错误

Merge pull request !3269 from zhongjianfei/zz0415
...@@ -518,7 +518,7 @@ getCacheDir(callback: AsyncCallback\<string>): void ...@@ -518,7 +518,7 @@ getCacheDir(callback: AsyncCallback\<string>): void
```js ```js
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getCacheDir(); var context = featureAbility.getContext();
context.getCacheDir((err, data) => { context.getCacheDir((err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
...@@ -571,7 +571,7 @@ getFilesDir(callback: AsyncCallback\<string>): void ...@@ -571,7 +571,7 @@ getFilesDir(callback: AsyncCallback\<string>): void
```js ```js
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getFilesDir(); var context = featureAbility.getContext();
context.getFilesDir((err, data) => { context.getFilesDir((err, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册