Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(useFileDialog): new function #1218

Merged
merged 11 commits into from Jul 6, 2022
6 changes: 6 additions & 0 deletions packages/core/useFileDialog/index.ts
Expand Up @@ -3,6 +3,11 @@ import { readonly, ref } from 'vue-demi'
export interface UseFileDialogOptions {
okxiaoliang4 marked this conversation as resolved.
Show resolved Hide resolved
multiple?: boolean
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?: 'user' | 'environment'
okxiaoliang4 marked this conversation as resolved.
Show resolved Hide resolved
}

const DEFAULT_OPTIONS: UseFileDialogOptions = {
Expand Down Expand Up @@ -35,6 +40,7 @@ export function useFileDialog(options?: Partial<UseFileDialogOptions>) {
}
input.multiple = _options.multiple!
input.accept = _options.accept!
input.capture = _options.capture!

okxiaoliang4 marked this conversation as resolved.
Show resolved Hide resolved
input.click()
}
Expand Down