Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 node.setAttrs({label:{text:''}}) 不起作用 #3992

Open
worthworld opened this issue Oct 26, 2023 · 0 comments
Open

使用 node.setAttrs({label:{text:''}}) 不起作用 #3992

worthworld opened this issue Oct 26, 2023 · 0 comments
Labels
type: bug 缺陷 Defects and unexpected behaviors

Comments

@worthworld
Copy link

问题描述

x6版本2.15.1初始化渲染数据,当节点值为 {label:{text:''}} 时显示 -
使用 node.setAttrs({label:{text:''}}) 不起作用
使用 node.setAttrs( {label:{ text:0 }} ) 也不起作用

重现链接

https://codesandbox.io/s/html-css-js-t245jd?file=/src/index.js

重现步骤

1、节点部分数据 {label:{text:''}} ,使用graph.fromJson渲染节点
2、使用 node.setAttrs({label:{text:''}}) 修改label的值

预期行为

作为用户,我希望fromJson渲染节点正常显示label值为空字符串的情况、node.setAttrs({label:{text:''}}) 生效把label的值置为空;但我看到的是fromJson渲染节点空字符串时为'-',node.setAttrs({label:{text:''}}) 时不生效

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

注: 不一定是label元素,其它具有text属性的元素也存在上述问题

@NewByVector NewByVector added the type: bug 缺陷 Defects and unexpected behaviors label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 缺陷 Defects and unexpected behaviors
Projects
None yet
Development

No branches or pull requests

2 participants