0
点赞
收藏
分享

微信扫一扫

【antd-vue】 a-tree 点击节点文字展开或收缩子节点

您好 2022-03-11 阅读 279

问题描述

a-tree 组件默认点击切换图标展开或收缩,如何做到点击节点文字也展开或收缩。

解决方法

在 onSelect 方法中调用 onExpand 方法

<template>
  <a-tree
    @select="onSelect"
  />
</template>
<script>
export default {
  methods: {
    onSelect(selectedKeys, {node}) {
	  node.onExpand()
	}
  },
};
</script>
举报

相关推荐

0 条评论