Closed xpalacincreditoh closed 2 years ago
When call openFilePicker console return: Error: TypeError: params.extensions.map is not a function
My SelectModal.vue:
openPicker(item) { switch (item.key) { case 'photo': this.mediaService.showCameraPicker().then((files) => { item.files = files; this.$modal.close(item); }); break; case 'gallery': this.mediaService.showGalleryPicker().then((files) => { item.files = files; this.$modal.close(item); }); break; case 'file': this.mediaService.showFilePicker().then((files) => { item.files = files; this.$modal.close(item); }); break; default: this.$modal.close(item); break; } },
My MediaService.js:
import { openFilePicker } from '@nativescript-community/ui-document-picker'; export default class MediaService { showCameraPicker() { openFilePicker({ extensions: 'jpg', multipleSelection: true, }); } showGalleryPicker() { openFilePicker({ extensions: 'jpg', multipleSelection: true, }); } showFilePicker() { openFilePicker({ extensions: 'pdf', multipleSelection: true, }); } }
@xpalacincreditoh the errors tells you that extensions should be an array
extensions
When call openFilePicker console return: Error: TypeError: params.extensions.map is not a function
My SelectModal.vue:
My MediaService.js: