Category | Browser |
---|---|
Export Size | 693 B |
Last Changed | last month |
Open file dialog with ease.
import { useFileDialog } from '@vueuse/core' const { files, open, reset, onChange } = useFileDialog() onChange((files) => { /** do something with files */ })
<template> <button type="button" @click="open">Choose file</button> </template>
export interface UseFileDialogOptions extends ConfigurableDocument { /** * @default true */ multiple?: boolean /** * @default '*' */ accept?: string /** * Select the input source for the capture file. * @see [HTMLInputElement Capture](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture) */ capture?: string } export interface UseFileDialogReturn { files: Ref<FileList | null> open: (localOptions?: Partial<UseFileDialogOptions>) => void reset: () => void onChange: EventHookOn<FileList | null> } /** * Open file dialog with ease. * * @see https://vueuse.org/useFileDialog * @param options */ export declare function useFileDialog( options?: UseFileDialogOptions ): UseFileDialogReturn
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/useFileDialog/