G6 icon indicating copy to clipboard operation
G6 copied to clipboard

点击节点无法实现字体高亮显示

Open kfcvime50 opened this issue 4 years ago • 0 comments

问题描述

#3052并没有解决,只是让子节点样式改了背景色,但是字体颜色却不能改啊,attr 和.updateItem我都试了,总有问题, ,请问下如何实现点击标签 字体和背景都高亮显示,文档看裂开了

重现链接

https://g6.antv.vision/zh/examples/tree/customItemTree#customEdgeTree

重现步骤

点击字体无法高亮 graph.on('node:click', (e) => { graph.updateItem(e.item, { labelCfg:{ style:{ fill: 'red' } }, }); graph.findAllByState('node', 'actived').forEach((node) => { graph.setItemState(node, 'actived', false);
}); graph.setItemState(e.item, 'actived', true); // e.shape.attr('fill','#f00') // console.log(e.item)

});

预期行为

实现字体背景色同时高亮显示

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

kfcvime50 avatar May 27 '22 10:05 kfcvime50