頁面寫死el-select下拉框標簽: 通過v-for="item in stateArr"綁定,stateArr聲明在Vue組件裡面的data參數裡面代碼如下: <el-form class="small-space" :model="createdItem" label-position="le ...
頁面寫死el-select下拉框標簽:
通過v-for="item in stateArr"綁定,stateArr聲明在Vue組件裡面的data參數裡面代碼如下:
<el-form class="small-space" :model="createdItem" label-position="left" label-width="100px" style='width: 100%; margin-left:0px;'> <el-form-item label="產品編號" :required=true> <el-input name="c_ID" v-model="createdItem.c_ID" autoComplete="on" maxlength="20"></el-input> </el-form-item> <el-form-item label="產品名稱" :required=true> <el-input name="c_Name" v-model="createdItem.c_Name" autoComplete="on" maxlength="20"></el-input> </el-form-item> <el-form-item label="產品狀態"> <el-select v-model="createdItem.c_State" placeholder="請選擇" style="width: 100%"> <el-option v-for="item in stateArr" :key="item.value" :label="item.label" :value="item.value"></el-option> </el-select> </el-form-item> </el-form>