vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.06k stars 6.91k forks source link

fix(VFileInput): emit single file when default model value is undefined & multiple is false #19656

Closed yuwu9145 closed 1 week ago

yuwu9145 commented 1 week ago

v-model emits array when initialised to undefined, but null emits single file

Description

Markup:

<template>
  <v-app>
    <v-container>
      <v-file-input
        label="File input"
        v-model="msg"
      />
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref, watch } from 'vue'

  const msg = ref()

  watch(msg, val => {
    console.log('isArray', Array.isArray(val))
    console.log(val)
  })
</script>