JSFiddle - React, Tailwind, and code Playground
by Yerko Palma
HTML
<div id="app">
<select v-model="selectedAge">
<option value="0">No age limit</option>
<option v-for="age in ages">{{age}}</option>
</select>
<p>
your option <b>{{selectedAge}}</b>
</p>
</div>
JavaScript
new Vue({
el: "#app",
data: {
rangeLimit: 90,
selectedAge: 0
},
computed: {
ages: function () {
let arr = []
for (let i of Array(this.rangeLimit - 6).keys()) {
arr.push(i + 6)
}
return arr
}
}
})