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

[Feature Request] VFileUpload Enhancement #20956

Open
3dyuval opened this issue Feb 2, 2025 · 0 comments
Open

[Feature Request] VFileUpload Enhancement #20956

3dyuval opened this issue Feb 2, 2025 · 0 comments

Comments

@3dyuval
Copy link

3dyuval commented Feb 2, 2025

Problem to solve

I pretty much love VFileUpload (introduced 3.7.6) and feel honored to suggest a couple of essential tweaks it so it can fit our requirements.

  1. We want to hide the divider and icon.
  2. We need clear distinction VFileUpload's slots and VFileUploadItem's slots.
  3. We want all VField slots, such as #prepend, #append, #append-inner, etc.
  4. Expose the browse method to be callable from outside the component's template scope.
  5. Keep previously selected files when clicking browse

Proposed solution

  1. Hide the default divider and icon using hide-divider and hide-icon
    Example:
<VFileUpload hide-divider hide-icon />
  1. Clear distinction between VFileUpload slots and VFileUploadItem slots
    Example:
<v-file-upload>
  <template #prepend></template> 
  <!-- This is confusion, it's actually prepending to item -->

  <template #append-inner-item></template> 
  <!-- Looks more clear ^_^  -->
</v-file-upload>
  1. All default slots that comes with VField
    Example:
<v-file-upload>
  <template #prepend-inner></template>
  <template #append-inner></template> 
  <template #clear></template> 
  <template #default></template> 
  <template #label></template> 
  <template #lodaer></template> 
</v-file-upload>
  1. Expose the browse mechanism using a callback
    Example:
<script setup>
const fileUploadComponent = ref<InstanceType<typeof VFileUpload>>(null);
</script>
<template>
  <v-btn @click="fileUploadComponent?.browse()" />
  <v-file-upload ref="fileUploadComponent" />
</template>
  1. I suggest keeping previously selected files when clicking browse the default behavior that could be disabled by a clear-on-browse prop
    Current behavior is clearing previously selected files when browse is clicked

Example

<script setup>
const files = ref([])
</script>

<template>
<v-file-upload
  clear-on-browse
/>
</template>
@3dyuval 3dyuval changed the title [Feature Request] [Feature] VFileUpload Enhancement [Feature Request] VFileUpload Enhancement Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant