Feat:node_tag_click事件新增两个回调参数

This commit is contained in:
街角小林 2024-07-09 15:54:06 +08:00
parent f79918ec6f
commit 12c6479c0d

View File

@ -302,7 +302,7 @@ function createTagNode() {
let { maxTag, tagsColorMap } = this.mindMap.opt let { maxTag, tagsColorMap } = this.mindMap.opt
tagsColorMap = tagsColorMap || {} tagsColorMap = tagsColorMap || {}
const nodes = [] const nodes = []
tagData.slice(0, maxTag).forEach(item => { tagData.slice(0, maxTag).forEach((item, index) => {
let str = '' let str = ''
let style = { let style = {
...defaultTagStyle ...defaultTagStyle
@ -320,7 +320,7 @@ function createTagNode() {
// 创建容器节点 // 创建容器节点
const tag = new G() const tag = new G()
tag.on('click', () => { tag.on('click', () => {
this.mindMap.emit('node_tag_click', this, item) this.mindMap.emit('node_tag_click', this, item, index, tag)
}) })
// 标签文本 // 标签文本
const text = new Text().text(str) const text = new Text().text(str)