默认选项(“选择默认元数据”)不是渲染,而是选择作为视图,任何人都可以提供帮助吗?
<div class="input-field col s12">
<select id="custom-select-f" v-model="meta_id" class="browser-default">
<option value="" disabled :selected="meta_id ? false : true">Choose Default Meta Data</option>
<option value="">Set As None</option>
<option v-for="meta in metas" :value="meta.id">{{meta.data}}</option>
</select>
<label for="custom-select-f" class="active">Meta Data</label>
</div>
答案 0 :(得分:0)
我没有绑定到所选属性,而是选择了一个假冒的&#39;值: https://jsfiddle.net/DarkFruits/5mk2hrfn/
<select name="" id="select" v-model='name'>
<option value="none" disabled >None</option>
<option value="max" >Max</option>
<option value="alex" >alex</option>
<option v-for='n in names' :value="n">{{n}}</option>
</select>
new Vue({
el: '#select',
data() {
return {
names: ['Sandy', 'Pete'],
name: 'none',
}
}
})