Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timelines 设置了没有效果 #137

Open
xkhanhan opened this issue Jan 6, 2025 · 1 comment
Open

timelines 设置了没有效果 #137

xkhanhan opened this issue Jan 6, 2025 · 1 comment

Comments

@xkhanhan
Copy link

xkhanhan commented Jan 6, 2025

我想实现你dome里的这种开头结尾有一条时间线的效果
image

但我只找到了timelines 这个字段似乎是用来设置的,我的设置方式如下
image
我表格数据如下

 const startTime = ref(moment().startOf('week').format('YYYY-MM-DD HH:mm:ss'))
    const endTime = ref(moment().startOf('week').add(5, 'd').format('YYYY-MM-DD HH:mm:ss'))

const data = [
      {
        id: 'test', //非必须
        name: '李磊',
        gtArray: [
          //默认的需要渲染的数组
          {
            name: '配音', //非必须
            start: '2025-01-05 00:00:00',
            end: '2025-01-07 18:18:18',
          },
        ],
      },
      {
        id: 'test2', //非必须
        name: '李磊2',
        gtArray: [
          //默认的需要渲染的数组
          {
            name: '文案', //非必须
            start: '2025-01-06 18:18:18',
            end: '2025-01-08 18:18:18',
          },
        ],
      },
    ]
    
      <VGanttChart
      :showCurrentTime="true"
      :startTime="startTime"
      :scale="360"
      dataKeys="id"
      :arrayKeys="['gtArray']"
      :endTime="endTime"
      :datas="data"
      :cellWidth="100"
      :cellHeight="70"
      :timelines="[
        { id: '1', time: '2025-01-06 18:18:18', color: '#00000' },
        { id: '2', time: '2025-01-08 18:18:18', color: '#00000' },
      ]"
    />

关于 markLine 插槽我发现我使用了似乎没有效果,组件没有渲染,我尝试在 timeline 测试我的组件是否有问题,但是timeline 中我的组件是正常渲染的
@xkhanhan
Copy link
Author

xkhanhan commented Jan 6, 2025

补充一条,scale 设置了超过 360 的值后,在开发模式下会报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant