[Vuejs]-How to set default value in select drop down menu in html using Vue?

0👍

If I understand your question correctly, this should be the solution:

var app = new Vue({
  el: "#app",
  data(){
    return {
            options: ["1999-00","2000-01","2001-02","2002-03","2003-04","2004-05","2005-06","2006-07","2007-08","2008-09"],
            age:"1999-00",
            }
         }
 })
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<div class="custom-select">
    <select class="select" v-model="age">
        <option disabled value="null">Year</option>
        <option v-for="option in options" :value="option">{{option}}</option>
    </select>
</div>
</div>

Leave a comment