diff --git a/src/views/demo/tree/ActionTree.vue b/src/views/demo/tree/ActionTree.vue index 6f9f31ecb..b17a6cced 100644 --- a/src/views/demo/tree/ActionTree.vue +++ b/src/views/demo/tree/ActionTree.vue @@ -14,7 +14,7 @@ 设置选中数据 获取选中数据 获取选中节点 - + 获取Tree数据 设置展开数据 获取展开数据 @@ -118,6 +118,11 @@ }); } + function handleGetTreeData() { + const treeDataRef = getTree().getTreeData(); + createMessage.success(JSON.stringify(treeDataRef.value)); + } + return { treeData, treeRef, @@ -134,6 +139,7 @@ updateNodeByKey, checkAll, expandAll, + handleGetTreeData, }; }, });