当前位置: 首页 > news >正文

vue vxe-gantt 甘特图自定义任务条样式模板 table 自定义插槽模板

vue vxe-gantt 甘特图自定义任务条样式模板 table 自定义插槽模板
当需要渲染自定义内容模板是,就可以通过插槽来实现,非常灵活

查看官网:https://vxeui.com
Github:https://github.com/x-extends/vxe-gantt
Gitee:https://gitee.com/x-extends/vxe-gantt

在这里插入图片描述

代码

通过自定义插槽 task-bar 来实现

<template><div><vxe-gantt v-bind="ganttOptions"><template #task-bar="{ row }"><div class="custom-task-bar" :style="{ backgroundColor: row.bgColor }"><div><vxe-image :src="row.imgUrl" height="30" circle></vxe-image></div><div><div>{{ row.title }}</div><div>已完成:{{ row.progress }}%</div></div></div></template></vxe-gantt></div>
</template><script setup>
import { reactive } from 'vue'const ganttOptions = reactive({border: true,taskViewConfig: {tableStyle: {width: 380}},taskBarConfig: {barStyle: {round: true}},columns: [{ field: 'title', title: '任务名称' },{ field: 'start', title: '开始时间', width: 100 },{ field: 'end', title: '结束时间', width: 100 }],data: [{ id: 10002, title: '城市道路修理进度', start: '2024-03-03', end: '2024-03-08', progress: 10, bgColor: '#3fd227', imgUrl: 'https://vxeui.com/resource/avatarImg/avatar7.jpeg' },{ id: 10004, title: '超级大工程', start: '2024-03-05', end: '2024-03-11', progress: 15, bgColor: '#fd9393', imgUrl: 'https://vxeui.com/resource/avatarImg/avatar1.jpeg' },{ id: 10006, title: '一个小目标项目', start: '2024-03-10', end: '2024-03-21', progress: 5, bgColor: '#92c1f1', imgUrl: 'https://vxeui.com/resource/avatarImg/avatar6.jpeg' },{ id: 10007, title: '某某计划', start: '2024-03-15', end: '2024-03-24', progress: 70, bgColor: '#fad06c', imgUrl: 'https://vxeui.com/resource/avatarImg/avatar8.jpeg' },{ id: 10008, title: '某某科技项目', start: '2024-03-20', end: '2024-03-29', progress: 50, bgColor: '#4aeaf2', imgUrl: 'https://vxeui.com/resource/avatarImg/avatar4.jpeg' }]
})
</script><style lang="scss" scoped>
.custom-task-bar {display: flex;flex-direction: row;padding: 2px 6px;width: 100%;font-size: 12px;
}
</style>

https://gitee.com/x-extends/vxe-gantt

http://www.xdnf.cn/news/1345213.html

相关文章:

  • Vue2 响应式系统设计原理与实现
  • 【Java并发编程】Java多线程深度解析:状态、通信与停止线程的全面指南
  • 多态(polymorphism)
  • celery
  • 学习python第12天
  • 基于Python的伊人酒店管理系统 Python+Django+Vue.js
  • 探索Thompson Shell:Unix初代Shell的智慧
  • Linux之Ubuntu入门:Vmware中虚拟机中的Ubuntu中的shell命令-常用命令
  • 解决 PyTorch 导入错误:undefined symbol: iJIT_NotifyEvent
  • MTK Linux DRM分析(十一)- MTK KMS Panel显示屏驱动
  • 使用html+css+javascript练习项目布局--创建导航栏
  • Linux驱动开发笔记(六)——pinctrl GPIO
  • MTK Linux DRM分析(十三)- Mediatek KMS实现mtk_drm_drv.c(Part.1)
  • chapter07_初始化和销毁方法
  • 【连接器专题】连接器接触界面的理解
  • CoreShop微信小程序商城框架开启多租户-添加一个WPF客户端以便进行本地操作--读取店铺信息(6)
  • 彩笔运维勇闯机器学习--最小二乘法的数学推导
  • 在线教育领域的视频弹题功能如何打造高互动性在线课程
  • 【Tech Arch】Hadoop YARN 大数据集群的 “资源管家”
  • 全栈开发:从LAMP到云原生的技术革命
  • Kali Linux 发布重构版Vagrant镜像:通过命令行快速部署预配置DebOS虚拟机
  • Pandas中的SettingWithCopyWarning警告出现原因及解决方法
  • DbLens:告别手动Mock数据,右键一键智能生成数据库内容
  • httpclient与hertzclient在处理Host header时的差别
  • 【GPT入门】第53课 LlamaFactory微调效果与vllm部署效果不一致问题解决
  • open webui源码分析6-Function
  • FPGA学习笔记——简单的IIC读写EEPROM
  • FPGA高端项目:图像采集+Aurora 8B10B+UDP图传架构,基于GTH高速收发器的光口转网口,提供工程源码和技术支持
  • IntelliJ IDEA 常用快捷键笔记(Windows)
  • SRE系列(二) | 从可用性到 SLI/SLO