[已解决]antd a-select Duplicate keys detected: ‘55‘. This may cause an update error.

在Vue应用中,遇到Duplicate keys错误提示'Duplicate keys detected: '55'. This may cause an update error.',该错误通常发生在key值重复的情况下。即便在key值唯一,但value值重复时也会引发此问题。博主通过调整数据,确保数组中的value值不重复后,错误消失。文章记录了这一现象,并寻求对此问题有深入理解的大神解答。
摘要由CSDN通过智能技术生成

Duplicate keys detected: ‘55‘. This may cause an update error.

Duplicate keys detected: '55'. This may cause an update error.
 <a-form-item label="供货商" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
                     
                      <a-select
                        mode="combobox"
                        allowClear
                        :getPopupContainer="(triggerNode) => triggerNode.parentNode"
                        v-decorator="['riskCategoryId', { rules: [{ required: true, message: '请选择或输入供货商' }] }]"
                        style="width: 100%"
                        placeholder="请选择或输入供货商"
                        @change="handleChange"
                      >
                        <a-select-option
                          v-for="(item) in supplierList"
                          :value="item.SupplierText"
                          :key="item.id"
                        >
                          {{ item.SupplierText }} - {{ item.SupplierPersonel }} - {{ item.SupplierContact }}
                        </a-select-option>
                      </a-select>
                    </a-form-item>

在我的key值唯一的情况下,我发现value值重复的情况下同样报Duplicate keys detected: ‘55’. This may cause an update error.不知道我的结论是否正确。但当数组中的value值变成不重复的时候,确实就不报这个错误了。

希望遇到大神能给我解惑,先记录一下这个问题。

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值