Element-ui2 form select display problem

when editing user information, how the element-ui2 form displays the previous company name (item.Name) of the user in the select selection box is normal in option, but opening the edit page selection box does not display the previous data.

      <el-form-item label="" prop="owner_id">
          <el-select v-model="editForm.owner_id" value-key="label" style="width: 100%;">
          <el-option v-for="item in customers" :key="item.Id" v-bind:label="item.Name" v-bind:value="item.Id"></el-option>
          </el-select>
      </el-form-item>

Mar.03,2021

send your more complete code to see


element-ui2 has not been used, but if you want to set a default value, you can add selected attribute to option .


is my own problem. EditForm.owner_id did not get the correct value in the background, and the default value of select is to display the value in v-model.

Menu