วิธีการ PickerBuilder.setSelectableMimeTypes
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
กำหนดรายการประเภท MIME ที่จะเลือกได้ ใช้คอมมาคั่นประเภท MIME หากจำเป็นต้องใช้มากกว่า 1 ประเภท หากคุณไม่ได้ตั้งค่าประเภท MIME ระบบจะแสดงไฟล์ประเภท MIME ทั้งหมดในมุมมอง
ตัวอย่าง
การใช้งานพื้นฐานที่มี MIME หลายประเภท
const mimeTypes = ['image/png', 'image/jpeg'];
const builder = new google.pickerPickerBuilder()
.setSelectableMimeTypes(mimeTypes.join(','));
ประเภท MIME ของ Google Workspace
const mimeTypes = [
'application/vnd.google-apps.document',
'application/vnd.google-apps.presentation',
'application/vnd.google-apps.spreadsheet',
];
const builder = new google.pickerPickerBuilder()
.setSelectableMimeTypes(mimeTypes.join(','));
ลายเซ็น
setSelectableMimeTypes(type: string): PickerBuilder;
รายละเอียด
ไม่บังคับ |
ไม่ได้ |
รอบชิงชนะเลิศ |
ไม่ได้ |
มีการป้องกัน |
ไม่ได้ |
คงที่ |
ไม่ได้ |
พารามิเตอร์
ชื่อ |
ประเภท |
ไม่บังคับ |
คำอธิบาย |
type |
string |
ไม่ได้ |
|
การคืนสินค้า
PickerBuilder
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# Method PickerBuilder.setSelectableMimeTypes\n\nSet the list of MIME types which will be selectable. Use commas to separate\nMIME types if more than one is required. If you don't set MIME types, files of\nall MIME types are displayed in the view.\n\nExamples\n--------\n\nBasic usage with multiple MIME types \n\n const mimeTypes = ['image/png', 'image/jpeg'];\n const builder = new google.pickerPickerBuilder()\n .setSelectableMimeTypes(mimeTypes.join(','));\n\nGoogle Workspace MIME types \n\n const mimeTypes = [\n 'application/vnd.google-apps.document',\n 'application/vnd.google-apps.presentation',\n 'application/vnd.google-apps.spreadsheet',\n ];\n\n const builder = new google.pickerPickerBuilder()\n .setSelectableMimeTypes(mimeTypes.join(','));\n\nSignature\n---------\n\n setSelectableMimeTypes(type: string): PickerBuilder;\n\nDetails\n-------\n\n| Optional | No |\n| Final | No |\n| Protected | No |\n| Static | No |\n|-----------|----|\n\nParameters\n----------\n\n| Name | Type | Optional | Description |\n|--------|----------|----------|-------------|\n| `type` | `string` | No | |\n\nReturns\n-------\n\n[PickerBuilder](./picker.pickerbuilder)"]]