xpyjs / gantt

An easy-to-use Gantt component. 持续更新,中文文档

Home Page:https://docs.xiaopangying.com/gantt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]DEMO里面的组合式写法,表格全部是空,且目前我运用在项目里 也出现了表格渲染不出来的问题

RanRuan opened this issue · comments

paste your code pls?

paste your code pls?

[
gantt-master.zip
](url)

paste your code pls?
gantt-master.zip

paste minimum reproduction code, not zip. I can see it in here

<template>
  <div class="gantt-wrap">
    <x-gantt
      data-id="index"
      :data="ganttData"
      header-height="48"
      :row-height="30"
    >
      <x-gantt-column label="事项" prop="name"></x-gantt-column>
    </x-gantt>
  </div>
</template>

<script lang="ts" setup>
import { reactive, ref, onMounted } from 'vue';
const ganttData = reactive([
{
    "index": 2,
    "name": "t1",
    "startDate": new Date('2022-01-24'),
    "endDate": new Date('2022-07-24'),
    "o": {
        "t1": "a",
        "t2": "b"
    },
    "children": [
        {
            "index": 51,
            "name": "sub-t51",
            "startDate": new Date('2022-01-27'),
            "endDate": new Date('2022-02-24'),
            "progress": 0.8,
            "o": {
                "t1": "a",
                "t2": "b"
            }
        },
        {
            "index": 52,
            "name": "sub-t52",
            "startDate":new Date('2022-03-27'),
            "endDate": new Date('2022-04-27'),
            "progress": 0.5,
            "o": {
                "t1": "a",
                "t2": "b"
            },
            "children": [
                {
                    "index": 53,
                    "name": "sub-sub-t53",
                    "startDate": new Date('2022-06-27'),
                    "endDate": new Date('2022-06-28'),
                    "progress": 0.3333333333,
                    "o": {
                        "t1": "a",
                        "t2": "b"
                    }
                }
            ]
        }
    ]
}

]);</script>

paste minimum reproduction code, not zip. I can see it in here

When the length of ganttData is equal to 1, it displays blank.
image

paste minimum reproduction code, not zip. I can see it in here

I found in the source code src\composables\useInView.ts,line 14 :

  // 预加载条数
  const preload = 5;

看到了代码,运行了一下,结果如下图:

image

并没有你说的问题。

1、检查你的代码
2、确保已经升级到最新版本

paste minimum reproduction code, not zip. I can see it in here

I found in the source code src\composables\useInView.ts,line 14 :

  // 预加载条数
  const preload = 5;

这个预加载是为了防止滚动时出现白屏,和你说的问题没有关系