wotamann / vuetify-form-base

Schema-based Form Generator - Vue.js 2.0 Component based on Vuetify 2.0
https://wotamann.github.io/vuetify
231 stars 63 forks source link

Error with File Input #70

Closed mcasto closed 3 years ago

mcasto commented 3 years ago

My model:

{
  campaignName: "",
  image: "",
  tagline: "",
}

My schema:

{
  campaignName: {
    col: 12,
    type: "text",
    label: "Name",
  },
  image: {
    col: 12,
    type: "file",
    label: "Image",
  },
  tagline: {
    col: 12,
    type: "textarea",
    label: "Tagline",
  },
}

This is the first time I've used the Field Input aspect of VFormBase, so it's probably something I'm doing wrong, but I get an error when the form renders:

Invalid prop: custom validator check failed for prop "value".

found in

---> <VFileInput>
       <VTooltip>
         <VFormBase>
           <VCard>
             <AddCampaign> at src/components/AddCampaign.vue
               <VThemeProvider>
...

Any ideas on what's causing this and how to resolve it?

Thanks.

mcasto commented 3 years ago

I should add that, aside from the error in the console, everything seems to work. When I click on the File Input field, I get a dialog & can select a file. The data for that file ends up in the model as I expect, so this isn't really a deal breaker for me (e.g.: I'll be able to use VFormBase regardless), but I would like to address the error.

mcasto commented 3 years ago

Well ... never mind. I figured it out on my own.

I defaulted model.image to an empty string (I don't know why I did that, but ...). I changed it to an empty object, and the error went away.

wotamann commented 3 years ago

Vuetifys <VFileInput> expects as value a single or array of File objects depending on prop "multiple" true or not.