如何使用以下数据创建下拉列表,并将其与Vue.js配对并从数据库中收集数据?
<div class="form-group">
<label for="pen-id">Pen Id:</label>
<input type="text" id="pen-id" class="form-control" v-model="trainManual.PenId">
</div>
如果您只想使用html,请在html的select选项标签中使用v-for,像这样
<select v-model="selected">
<option v-for="option in options" v-bind:value="option.value">
{{ option.text }}
</option>
</select>
但是最好使用bootstrap vue