X6 icon indicating copy to clipboard operation
X6 copied to clipboard

节点编辑器在mrkup中自定义setText和getText问题

Open 37-Ricardo opened this issue 2 years ago • 2 comments

问题描述

文档中描述如何在自定义了mrkup的节点中正确使用node-editor,其中正确编辑文本和获取文本需要自定义,示例中的代码 node.addTools({ name: 'node-editor', args: { getText: 'a/b', setText: 'c/d', }, }) 'a/b'和'c/d'是什么意思,不是很明白

重现链接

https://x6.antv.antgroup.com/api/registry/node-tool#node-editor

重现步骤

https://x6.antv.antgroup.com/api/registry/node-tool#node-editor

预期行为

解释一下,文档中'a/b'和'c/d'是什么意思

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox ...]
  • X6 版本: [2.11.1 ...]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

37-Ricardo avatar Dec 01 '23 08:12 37-Ricardo

👋 @37-Ricardo

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

x6-bot[bot] avatar Dec 01 '23 08:12 x6-bot[bot]

eg: getText: ({ cell }) => { const text = cell.attr("text"); return text; }, setText: ({ cell, value }) => { cell.attr("text", value); }

apankun avatar Dec 06 '23 08:12 apankun