el-select-display problem of value and label in el-option

el-select-display problem of value and label in el-option

  <	  el-select
	  v-model.trim="modifyLoopForm.lightingtype"
	  placeholder="亮灯类型"
	  value-key="id"
	  style="width: 100%"
	>
	  <el-option
	    v-for="item in lightingItem"
	    :key="item.id"
	    :label="item.light"
	    :value="item.id"
	  >
	  </el-option>
	</el-select>

"Id must be quoted" (important)

 lightingItem:[
        {
    
    
          id:'1',//这里的id一定要加引号
          light:"全夜灯"
        },
        {
    
    
          id:'2',
          light:"半夜灯"
        },
        {
    
    
          id:'3',
          light:"景观灯"
        }
      ],

Guess you like

Origin blog.csdn.net/weixin_43493113/article/details/113120828