Skip to content

显示数据不一致 #2

@chenghh-9609

Description

@chenghh-9609

这个组件库挺好用的,不过有个问题,在prop包含数值型(不管类型是number还是string)的情况下,显示的数据可能会错乱。
下面的数据prop为3时对应的单元格显示为1,与data里字段3对应的数据不一致:
image

columns = [
        {
          show: true,
          prop: "3",
          title: "3",
        },
        {
          show: true,
          prop: "age",
          title: "age",
        },
        {
          show: true,
          prop: "id",
          title: "id",
        },
        {
          show: true,
          prop: "row",
          title: "row",
          fixed: "left",
        },
      ];
data = [
        {
          row: "row",
          id: "id",
          1: "name",
          age: "age",
          3: 3,
        },
        {
          row: "row",
          id: "id",
          1: "name",
          age: "age",
          3: 3,
        },
      ];

我在使用的时候把一个二维数组转为data里的对象数组形式时,如果为columns添加一个string类型的prop与data里的字段对应时会报如下错误:
image
把所有prop都改为string与data里的字段就可以正常显示了。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions