October 2019
Intermediate to advanced
108 pages
2h 24m
English
There are a couple more things that we need to do before we can close off this chapter. First of all, let's take care of BaseSelect; it still needs a validator property and some :class bindings.
Follow these steps to find out how we can do this:
validator: {type: Object, required: false, validator($v) { return $v.hasOwnProperty('$model'); }}
Now, let's add the :class binding; except here, we're not going to check against $dirty, because we don't have an initial empty value.
:class="{ 'is-valid': validator && !validator.$error, 'is-invalid': validator && validator.$error}"
Read now
Unlock full access