antvis/G6

iconText从div的属性获取导致渲染不正确 #5862

zhangsai521314 posted onGitHub

Describe the bug / 问题描述

1:定义一个div:<div id="ssss" iconUnicode='\ue602'> 2:使用document.getElementById('ssss').getAttribute('iconUnicode')获取值赋值给iconText 3:icon显示为字符

https://stackblitz.com/edit/react-dvck84?file=index.js

Steps to Reproduce the Bug or Issue / 重现步骤

1:定义一个div:<div id="ssss" iconUnicode='\ue602'> 2:使用document.getElementById('ssss').getAttribute('iconUnicode')获取值赋值给iconText 3:icon显示为字符

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Firefox

Additional context / 补充说明

No response


document.getElementById('ssss').getAttribute('iconUnicode') === '\ue602'

>> false

字符编码问题请自行解决

posted by Aarebecca 10 months ago

Fund this Issue

$0.00
Funded

Pull requests