I have several select drop-downs which pull data using an Axios call. I would like the drop-downs to be disabled (greyed out) if there are fewer than 2 options left. I have managed to disable a submit button as a proof of concept but I can't get the select menu itself to disable. Maybe you cant do it this way, I'm not sure. Like most folk who post Vue questions. I'm new to Vue :) Any help would be greatly appreciated.
<div id="app">
<select v-model="quantity">
<option disabled value="">Select</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
<button type="submit" :disabled="submitDisabled">Submit</button>
</div>
new Vue({
el: '#app',
data: {
quantity :""
},
computed: {
submitDisabled: function () {
return this.quantity < 2 ? true : false;
}
}
});