Duplicate keys detected: ''. This may cause an update error.

原因: 在用v-for进行循环时,:key值不唯一,有重复的内容,故报错.
解决方法:

v-for="item in options" :key="item.index+ '-label'"
data(){
  return {
  options: [
        {
          value: "",
          label: "全部"
        },
        {
          value: "1",
          label: "支付宝"
        },
        {
          value: "",
          label: "微信"
        }
      ]
}
}

你可能感兴趣的:(Duplicate keys detected: ''. This may cause an update error.)