vue select默認選中預設選項

HTML====

<!– VUE –>
<div id="app-4″>
<select name="e_location_id" id="e_location_id" v-model="cool">
<option v-for="todo in todos" :value="todo.d_id" >
{{ todo.d_title }}
</option>
</select>
</div>

 

JS====

var app4 = new Vue({
el: ‘#app-4′,
data: {
cool:’2’, //這邊默認id值即可 預設是該id值的選項
todos:[{“d_id" : “1″,"d_title" : “顆顆"},{“d_id" : “2″,"d_title" : “呵呵"}]
},

})