shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.66k stars 989 forks source link

Is it possible to give :class when validation error ? #1670

Open jonathanoeijoeng opened 1 year ago

jonathanoeijoeng commented 1 year ago

Is it possible to give like :class="{ 'border-red-500': errors.start_date, }" so it's border will change to red when there is validation error? Btw, I use tailwindcss

mattelen commented 1 year ago

Good idea, however validation is normally controlled by the parent, or other components, as the multi-select won't know what is valid, and what is not. However, having an error state for when the user has manually inputted something that isn't an option, I see benefits in that.

jonathanoeijoeng commented 1 year ago

Thanks you. What I meant was may you can give class border red that can be activated via parameter maybe if $condition == true then it will have red border