วิธีการ 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 และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-10-15 UTC
[null,null,["อัปเดตล่าสุด 2024-10-15 UTC"],[[["Defines the accepted file types for display in the Google Picker view."],["Uses a comma-separated string of MIME types to specify allowed file formats."],["If no MIME types are set, all file types will be visible."],["Provides examples for basic usage and Google Workspace specific MIME types."],["Returns a PickerBuilder object for chaining further configurations."]]],["The `setSelectableMimeTypes` method, part of `PickerBuilder`, filters selectable file types. It takes a comma-separated string of MIME types as input. If no MIME types are specified, all file types are selectable. Examples show usage with image types and Google Workspace types. This method, which is not optional, final, protected or static, returns a `PickerBuilder` object, and it is necessary to input a string value.\n"]]