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
Merged

Conversation

wobsoriano
Copy link
Contributor

Adds an open file dialog hook without struggling with file input.

packages/core/useFileDialog/index.ts Outdated Show resolved Hide resolved
packages/core/useFileDialog/index.ts Outdated Show resolved Hide resolved
}

return {
files: readonly(files),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's readonly, we might need an extra function reset

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, a reset function would be needed

wobsoriano and others added 3 commits February 8, 2022 22:12
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
packages/core/useFileDialog/index.ts Show resolved Hide resolved
...options,
...localOptions,
}
const input = document.createElement('input')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to move to the useFileDialog scope? I'm worried that using the open function multiple times will create too many input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved outside useFileDialog now. Thanks!

@antfu antfu merged commit 44526f0 into vueuse:main Jul 6, 2022
@wobsoriano wobsoriano deleted the feat-use-file-dialog branch July 7, 2022 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants