graph.on('node:mouseenter', () => { const container = document.getElementById('graph-container') ! const ports = container.querySelectorAll( '.x6-port-body', ) as NodeListOf < SVGElement > showPorts(ports, true) }) 转js代码
时间: 2024-01-15 15:05:28 浏览: 166
matlab-grid-on.rar_bar graph_site:www.pudn.com
以下是将 TypeScript 代码转换为 JavaScript 代码的示例:
```
graph.on('node:mouseenter', function() {
const container = document.getElementById('graph-container');
const ports = container.querySelectorAll('.x6-port-body');
showPorts(ports, true);
});
```
在上面的代码中,我们将类型注释去掉,并将箭头函数转换为普通的函数表达式。其余的代码保持不变。
阅读全文