X6 icon indicating copy to clipboard operation
X6 copied to clipboard

cell.prop('label')获取不到label值,也期望可以设置,同时label也更新

Open gdutwyg opened this issue 1 year ago • 5 comments

问题描述

创建一个节点,然后通过prop去获取它的label,获取不到; 设置后,发现无法节点label无法同步

重现链接

https://codesandbox.io/p/sandbox/compassionate-goldwasser-7dqvd8

重现步骤

  1. 创建一个节点
  2. 然后通过prop获取label
  3. 发现获取不到,设置也不成功

预期行为

cell.prop('label')获取成功,也可以设置成功

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

gdutwyg avatar Jan 13 '24 08:01 gdutwyg

👋 @gdutwyg

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 Jan 13 '24 08:01 x6-bot[bot]

获取:node.attr("text/text") 设置:node.attr("text/text","值")

cnyballk avatar Jan 16 '24 01:01 cnyballk

获取:node.attr("text/text") 设置:node.attr("text/text","值")

我知道attr,但是这个设置attr的text并不能同步修改label,我期望既可以修改label,又可以把修改后的同步到attr里面

image

gdutwyg avatar Jan 16 '24 06:01 gdutwyg

这个设置attr的text并不能同步修改label

实测是可以同步的

cnyballk avatar Jan 16 '24 12:01 cnyballk

.attr("text/text","值")

好的,谢谢,这个有效果,之前我看的官方文档,发现没效果才用的prop,你可以试试 https://x6.antv.antgroup.com/api/model/cell image

gdutwyg avatar Jan 17 '24 07:01 gdutwyg