x-extends / vxe-table-plugin-virtual-tree

停止维护
https://xuliangzhan_admin.gitee.io/vxe-table/#/table/scroll/tree
MIT License
22 stars 4 forks source link

子节点缩进错误 #8

Closed Aaron-Bird closed 4 years ago

Aaron-Bird commented 4 years ago

(必填)请填写问题描述或截图:

当为设置 indent 参数时, 树表缩进渲染错误, 例如:

缩进错误:

<vxe-virtual-tree :tree-config="{ children: 'children', line: true }">

1

缩进正确:

<vxe-virtual-tree :tree-config="{ children: 'children', line: true, indent: 20  }">

2

复现示例

<template>
  <div>
    <vxe-virtual-tree
      show-overflow
      row-key
      row-id="id"
      :data="tableData"
      :tree-config="{ children: 'children', line: true }"
      :columns="tableColumn"
      :checkbox-config="{ labelField: 'name', highlight: true }"
    >
    </vxe-virtual-tree>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableColumn: [
        { treeNode: true, type: "checkbox"},
        { field: "name", title: "Name",  },
        { field: "size", title: "Size" },
        { field: "type", title: "Type" },
        { field: "date", title: "Date" },
      ],
      tableData: [
        {
          id: "101",
          name: "文档1",
          size: 12,
          type: "xlsx",
          date: "2019-12-12",
        },
        {
          id: "102",
          name: "文件夹",
          size: 12,
          type: "",
          date: "2019-12-12",
          children: [
            {
              id: "103",
              name: "文档3",
              size: 12,
              type: "avi",
              date: "2019-12-12",
              children: [
                {
                  id: "104",
                  name: "文档4",
                  size: 12,
                  type: "avi",
                  date: "2019-12-12",
                },
              ],
            },
          ],
        },
      ],
    };
  },
};
</script>

(必填)请填在线链接:

(必填)请填写期望的结果:

显示正确的缩进 2

(必填)请填写以下信息:

xe-bot[bot] commented 4 years ago

机器人助手: