diff --git a/zh-cn/application-dev/reference/apis/js-apis-statfs.md b/zh-cn/application-dev/reference/apis/js-apis-statfs.md index b997b82927208e851a4f1c6495050c1262a6bc15..f4dedcedeeaa8cbe8a68160e6c0597d0c781298d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-statfs.md +++ b/zh-cn/application-dev/reference/apis/js-apis-statfs.md @@ -34,10 +34,10 @@ getFreeBytes(path:string):Promise<number> ```js let path = "/dev"; - statfs.getFreeBytes(path).then(function (number){ - console.info("getFreeBytes promise successfully:"+ number); - }).catch(function(err){ - console.info("getFreeBytes failed with error:"+ err); + statfs.getFreeBytes(path).then(function (number) { + console.info("getFreeBytes promise successfully:" + number); + }).catch(function (err) { + console.info("getFreeBytes failed with error:" + err); }); ``` @@ -59,11 +59,11 @@ getFreeBytes(path:string, callback:AsyncCallback<number>): void **示例:** ```js - import featureAbility from '@ohos.ability.featureAbility'; + import featureAbility from '@ohos.ability.featureAbility'; let context = featureAbility.getContext(); context.getFilesDir().then(function (path) { - statfs.getFreeBytes(path, function(err, number){ - console.info("getFreeBytes callback successfully:"+ number); + statfs.getFreeBytes(path, function (err, number) { + console.info("getFreeBytes callback successfully:" + number); }); }); ``` @@ -92,10 +92,10 @@ getTotalBytes(path: string): Promise<number> ```js let path = "/dev"; - statfs.getTotalBytes(path).then(function (number){ - console.info("getTotalBytes promise successfully:"+ number); - }).catch(function(err){ - console.info("getTotalBytes failed with error:"+ err); + statfs.getTotalBytes(path).then(function (number) { + console.info("getTotalBytes promise successfully:" + number); + }).catch(function (err) { + console.info("getTotalBytes failed with error:" + err); }); ``` @@ -120,8 +120,8 @@ getTotalBytes(path: string, callback: AsyncCallback<number>): void import featureAbility from '@ohos.ability.featureAbility'; let context = featureAbility.getContext(); context.getFilesDir().then(function (path) { - statfs.getTotalBytes(path, function(err, number){ - console.info("getTotalBytes callback successfully:"+ number); + statfs.getTotalBytes(path, function(err, number) { + console.info("getTotalBytes callback successfully:" + number); }); }); ```