4👍
✅
You can bind data to plain HTML attributes. It doesn’t need to be a component property.
<select class="form-control" :required="type == 2" ...></select>
Doing this, the select element will only have the required
attribute if type == 2
.
Source:stackexchange.com