// 树形控件选中checked时触发事件
<a-tree
class="a-tree"
v-model="selectedKeys"
@check="onCheckTree"
checkable
:expanded-keys="expandedKeys"
@select="clickTreeTabTow"
:tree-data="gData"
:checkedKeys="selectedKeys"
@expand="onExpand"
:replace-fields="{
children: 'children',
key: 'id',
title: 'categoryNameCn',
}"
>
</a-tree>
onCheckTree(e, info) {
var tempArr = []
info.checkedNodesPositions.forEach((item, index) => {
(item.node.data.props.dataRef.children || []).forEach((info) => {
if (info) {
tempArr.push(info.id)
console.log('tempArr', tempArr)
this.tabsTwoTreeID = tempArr
}
})
})
},