janiskelemen / formvuelar

Vue form components with server-side validation in mind
https://janiskelemen.github.io/formvuelar/
MIT License
300 stars 25 forks source link

FvlSelect.vue #2

Closed Barrykilby closed 5 years ago

Barrykilby commented 5 years ago

Hi Janis,

I was having issues with the select box updating my value or even rendering with the supplied value, after a little bit of digging it seems that FvlSelect is missing the value prop and line 16 should read:

@change="$emit('update:value', $event.target.value); $parent.dirty(name);"

To correctly emit the value/event?

Barry

janiskelemen commented 5 years ago

Hi Barry, I’m currently on vacation but I will take a look at it next week. You can also submit a pull request if you already have a fix. 😊

Sent with GitHawk

janiskelemen commented 5 years ago

hi,

I just looked into this and it seems that you are trying to set the value through the value instead of the key. Make sure that you use the key instead of the value to preselect or update the select field. If you don't have a key you can just use the same as the value like {'myvalue': 'myvalue'}

Janis