<el-form-item label="介面分類:" :label-width="formLabelWidth" prop="category"> <el-select v-model="form.category" placeholder="請選擇"> <el-option v-for="item in this.category_list" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> </el-form-item>
category_list值為: [ {"id": 20, "name": "交通銀行" }, {"id": 2, "name": "招商銀行" }]
v-model獲取的是<el-option>vaule的值,key和value為id的值,label為name的值