Open zzh4818 opened 3 years ago
不能,这个需要自己实现
好像可以用leaderline(新人四处抄来的)
import LeaderLine from 'leader-line-vue'; import AnimEvent from "anim-event"; const that = this; this.timer = setTimeout( function () { that.drawLeaderLine(that.myList); // this.done = 1; }, 1000) drawLeaderLine(list) {
list.forEach(element => {
let start = document.getElementById(element.id)
console.log(element.id)
if (element.children && element.children.length) {
element.children.forEach(child => {
let line = LeaderLine.setLine(start, document.getElementById(child.id))
line.color = 'rgba(30, 130, 250, 0.5)'
line.path = 'grid'
line.size = 3
// line.setOptions({
// dash: {animation: true},
// })
line.setOptions({ startSocket: 'left', endSocket: 'left', startSocketGravity: [1, 20], });
window.addEventListener('wheel', AnimEvent.add(function () {
console.log("scroll")
line.position()
}), false);
this.lines.push(line)
})
this.drawLeaderLine(element.children)
}
})
},
任务间会有某个参数关联,关联参数如果相同,我们想通过线段连接起来,组件能实现任务间的连线么? 类似于 https://dhtmlx.com/vue/demos/gantt/#/many/default