From 5e03ff85a7974df2155ae0e862994222c450edc0 Mon Sep 17 00:00:00 2001 From: yxn Date: Tue, 29 Aug 2023 18:05:39 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20c44c48f=20from=20https://gitee.com/yxn2?= =?UTF-8?q?2/docs/pulls/23421=20=E5=A4=84=E7=90=86=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yxn --- .../reference/apis/js-apis-file-picker.md | 51 ++++--------------- 1 file changed, 10 insertions(+), 41 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-file-picker.md b/zh-cn/application-dev/reference/apis/js-apis-file-picker.md index f6e78d77a8..b6c2930769 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-file-picker.md +++ b/zh-cn/application-dev/reference/apis/js-apis-file-picker.md @@ -8,8 +8,13 @@ ## 导入模块 +> **说明:** +> +> 示例代码里有使用BusinessError的都需要导入BusinessError模块,没有的话则不需要导入。 + ```ts import picker from '@ohos.file.picker'; +import { BusinessError } from '@ohos.base'; ``` ## PhotoViewPicker @@ -47,8 +52,6 @@ select(option?: PhotoSelectOptions) : Promise<PhotoSelectResult> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example01() { try { let PhotoSelectOptions = new picker.PhotoSelectOptions(); @@ -84,8 +87,6 @@ select(option: PhotoSelectOptions, callback: AsyncCallback<PhotoSelectResult& **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example02() { try { let PhotoSelectOptions = new picker.PhotoSelectOptions(); @@ -122,8 +123,6 @@ select(callback: AsyncCallback<PhotoSelectResult>) : void **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example03() { try { let photoPicker = new picker.PhotoViewPicker(); @@ -163,8 +162,6 @@ save(option?: PhotoSaveOptions) : Promise<Array<string>> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example04() { try { let PhotoSaveOptions = new picker.PhotoSaveOptions(); @@ -199,8 +196,6 @@ save(option: PhotoSaveOptions, callback: AsyncCallback<Array<string>> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example05() { try { let PhotoSaveOptions = new picker.PhotoSaveOptions(); @@ -236,8 +231,6 @@ save(callback: AsyncCallback<Array<string>>) : void **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example06() { try { let photoPicker = new picker.PhotoViewPicker(); @@ -289,8 +282,6 @@ select(option?: DocumentSelectOptions) : Promise<Array<string>> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example07() { try { let DocumentSelectOptions = new picker.DocumentSelectOptions(); @@ -324,8 +315,6 @@ select(option: DocumentSelectOptions, callback: AsyncCallback<Array<string **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example08() { try { let DocumentSelectOptions = new picker.DocumentSelectOptions(); @@ -360,8 +349,6 @@ select(callback: AsyncCallback<Array<string>>) : void **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example09() { try { let documentPicker = new picker.DocumentViewPicker(); @@ -402,8 +389,6 @@ save(option?: DocumentSaveOptions) : Promise<Array<string>> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example10() { try { let DocumentSaveOptions = new picker.DocumentSaveOptions(); @@ -438,8 +423,6 @@ save(option: DocumentSaveOptions, callback: AsyncCallback<Array<string> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example11() { try { let DocumentSaveOptions = new picker.DocumentSaveOptions(); @@ -475,8 +458,6 @@ save(callback: AsyncCallback<Array<string>>) : void **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example12() { try { let documentPicker = new picker.DocumentViewPicker(); @@ -528,8 +509,6 @@ select(option?: AudioSelectOptions) : Promise<Array<string>> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example13() { try { let AudioSelectOptions = new picker.AudioSelectOptions(); @@ -563,8 +542,6 @@ select(option: AudioSelectOptions, callback: AsyncCallback<Array<string> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example14() { try { let AudioSelectOptions = new picker.AudioSelectOptions(); @@ -599,8 +576,6 @@ select(callback: AsyncCallback<Array<string>>) : void **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example15() { try { let audioPicker = new picker.AudioViewPicker(); @@ -640,8 +615,6 @@ save(option?: AudioSaveOptions) : Promise<Array<string>> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example16() { try { let AudioSaveOptions = new picker.AudioSaveOptions(); @@ -676,8 +649,6 @@ save(option: AudioSaveOptions, callback: AsyncCallback<Array<string>> **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example17() { try { let AudioSaveOptions = new picker.AudioSaveOptions(); @@ -713,8 +684,6 @@ save(callback: AsyncCallback<Array<string>>) : void **示例:** ```ts -import { BusinessError } from '@ohos.base'; - async example18() { try { let audioPicker = new picker.AudioViewPicker(); @@ -783,9 +752,9 @@ async example18() { | 名称 | 类型 | 必填 | 说明 | | ----------------------- | ------------------- | ---- | -------------------------------- | -| maxSelectNumber | number | 否 | 选择文件/目录最大个数,上限500,有效值范围1-500 | -| defaultFilePathUri | string | 否 | 指定选择的文件或者目录路径 | -| fileSuffixFilters | Array<string> | 否 | 选择文件的后缀类型 | +| maxSelectNumber10+ | number | 否 | 选择文件/目录最大个数,上限500,有效值范围1-500 | +| defaultFilePathUri10+ | string | 否 | 指定选择的文件或者目录路径 | +| fileSuffixFilters10+ | Array<string> | 否 | 选择文件的后缀类型 | ## DocumentSaveOptions @@ -796,8 +765,8 @@ async example18() { | 名称 | 类型 | 必填 | 说明 | | ----------------------- | ------------------- | ---- | ---------------------------- | | newFileNames | Array<string> | 否 | 拉起documentPicker进行保存的文件名,若无此参数,则默认需要用户自行输入 | -| defaultFilePathUri | string | 否 | 指定保存的文件或者目录路径 | -| fileSuffixChoices | Array<string> | 否 | 保存文件的后缀类型 | +| defaultFilePathUri10+ | string | 否 | 指定保存的文件或者目录路径 | +| fileSuffixChoices10+ | Array<string> | 否 | 保存文件的后缀类型 | ## AudioSelectOptions -- GitLab