Skip to content

轮播表提示key重复 #8

@XueMeijing

Description

@XueMeijing

Bug report

轮播表的key是如何确定的? data: [[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]]这样会报错,提示有重复的key,显示异常,并且每次轮播都会新增一列数据。把data中的number 1变成string 1,data: [['1',0],['1',0],['1',0],['1',0],['1',0],['1',0],['1',0],['1',0],['1',0],['1',0],['1',0]],就正常了

出现Bug的组件?

轮播表

组件配置数据?

config = {
header,
data: [[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
rowNum: 8,
headerBGC: 'rgba(0,0,0,.3)', // #00BA66
oddRowBGC: 'transparent', // '#609bdf', 'transparent'
evenRowBGC: 'transparent', // '#ffa324', 'transparent'
index: true,
}

控制台错误输出?

warning: Encountered two children with the same key, 4. Keys should be unique so that components maintain their identity across updates.

期望情况?

image

实际情况?

image

其他相关信息

  • DataV版本
    "^1.2.1"
  • 浏览器版本
    chrome83
  • 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions