bpmn添加悬浮弹框

827 阅读1分钟
// 移入增加
const that = this
this.bpmnModeler.on("element.hover".function(event){
let overlays = that.bpmnModeler.get('overlays')
overlays.add(event.element.id, 'note', {
 position: {
  top:0,
  bottom:0
},
html:'<div class="demo"></div>'
})})
// 移出清除
this.bpmnModeler.on("element.out".function(event){
let overlays = this.bpmnModeler.get('overlays')
overlays.clear()
})

.demo:{ // 添加弹窗样式 }

可以根据event里面的originalEvent.Y获取当前鼠标位置,动态显示弹窗向上显示还是向下显示