vue 报错Duplicate keys detected: '1'. This may cause an update error.

    xiaoxiao2022-06-30  192

    vue 报错Duplicate keys detected: ‘1’. This may cause an update error.

    出现这个原因的报错是因为下拉框的key值不是唯一的

    <FormItem label="学校" prop="schoolName"> <Select v-model="showEditForm.schoolId" placeholder="Select your school"> <Option v-for="schoolNameId in schoolNameIds" :label="schoolNameId.schoolName" :value="schoolNameId.schoolId" :key="schoolNameId.schoolId"> {{schoolNameId.schoolName}} </Option> </Select> </FormItem>

    :key="schoolNameId.schoolId 必须是唯一的才行


    最新回复(0)