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

logicFlow ,画布节点自定义

class CustomRectNode extends RectNode {/*** @description 重写此方法,自定义节点形状。* @returns VNode*/getShape() {const { model } = this.propsconst { x, y, width, height, radius } = modelconst style = model.getNodeStyle()// 矩形形状const rect = h('rect', {...style,x: x - width / 2,y: y - height / 2,width,height,rx: radius,ry: radius,})// 使用 foreignObject 渲染 HTML,以支持 CSS 的文本溢出省略const text = h('foreignObject', {x: x - width / 2,y: y - height / 2,width,height,style: 'overflow: visible; display: flex; justify-content: center; align-items: center;',children: [h('div', {style: {...model.getTextStyle(),width: '100%',height: '100%',display: 'flex','justify-content': 'center','align-items': 'center','white-space': 'nowrap',overflow: 'hidden','text-overflow': 'ellipsis',padding: '0 5px',},title: model.text.value, // hover时显示完整文本
          domProps: {innerHTML: model.text.value,},}),],})return h('g', {}, [rect, text])}
}

 

http://www.jsqmd.com/news/42153/

相关文章:

  • 哈希从入门到入土『给学弟学妹们讲课用的』
  • 20232303 2025-2026-1 《网络与系统攻防技术》实验五实验报告
  • 学校真好!
  • NOIP2025模拟9
  • .net 8+, 类库无法引用 WebApplication 的解决方案
  • 网络分析模型七
  • 2025-11-16
  • iOS移动端H5键盘弹出时页面布局异常和滚动解决方案 - 详解
  • P14092 [ICPC 2023 Seoul R] M. S. I. S.
  • temperature、top_p、top_k
  • PyCharm gitee: Git Pull Failed
  • python方便的桌面应用.customtkinter
  • 红队、蓝队与紫队:网络安全攻防演练的三大支柱
  • 2025年11月副业平台评价榜:零门槛生态对比助你安全增收
  • 全球云服务震荡:Amazon Web Services (AWS) 出现大规模故障 多项线上服务受冲击 - 实践
  • 调整电话交换机 3CX 对接微软 Teams 直接路由
  • 20232406 2025-2026-1 《网络与系统攻防技术》实验五实验报告
  • 20232315 2025-2026-1 《网络与系统攻防技术》实验五实验报告
  • spark启动方式
  • 2025.11.16模拟赛
  • Pycharm为什么会自动创建__pycache__
  • 20232325 2025-2026-1 《网络与系统攻防技术》实验五实验报告
  • 12.docker swarm - 指南
  • 山东大学 计算机图形学实验 二维网格剖分 Catmull-Clark算法
  • 从Ubuntu安装Harbor故障到了解AppArmor 与 Seccomp的思考
  • 什么是“组态路径”?
  • 2025年11月防冻液厂家推荐榜:五家对比与性能评价一览
  • 深入探索剖析 JVM 的启动过程
  • noip8多校2