beforecollapseexpandcombo 事件的action值无论是展开还是折叠都是expand #4737
zhang-yanglong posted onGitHub
Describe the bug
graph.on('beforecollapseexpandcombo', ({action, item}) => { item.get('model').label = action; }
Your Example Website or App
https://g6.antv.antgroup.com/zh/examples/item/defaultCombos/#rect
Steps to Reproduce the Bug or Issue
import G6 from '@antv/g6';
const data = { nodes: [ { id: 'node1', x: 250, y: 150, comboId: 'combo', }, { id: 'node2', x: 350, y: 150, comboId: 'combo', }, ], combos: [ { id: 'combo', label: 'Combo', }, ], };
const width = document.getElementById('container').scrollWidth; const height = document.getElementById('container').scrollHeight || 500; const graph = new G6.Graph({ container: 'container', width, height, fitCenter: true, groupByTypes: false, modes: { default: ['drag-canvas', 'drag-node', 'drag-combo', 'collapse-expand-combo'], }, defaultCombo: { type: 'rect', size: [50, 50], labelCfg: { position: 'top', }, }, });
graph.data(data); graph.render(); graph.on('beforecollapseexpandcombo', ({action, item}) => { item.get('model').label = action; })
Expected behavior
展开时为expand,折叠时为collapse
Screenshots or Videos
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response