问题描述
a-tree
组件默认点击切换图标展开或收缩,如何做到点击节点文字也展开或收缩。
解决方法
在 onSelect 方法中调用 onExpand 方法
<template>
<a-tree
@select="onSelect"
/>
</template>
<script>
export default {
methods: {
onSelect(selectedKeys, {node}) {
node.onExpand()
}
},
};
</script>