chore(demo->BasicTree): 增加获取当前tree数据示例. resolve #3253

This commit is contained in:
invalid w 2023-11-09 09:57:01 +08:00
parent 748b99b18f
commit 90b45b3a51

View File

@ -14,7 +14,7 @@
<a-button @click="handleSetSelectData" class="mr-2"> 设置选中数据 </a-button> <a-button @click="handleSetSelectData" class="mr-2"> 设置选中数据 </a-button>
<a-button @click="handleGetSelectData" class="mr-2"> 获取选中数据 </a-button> <a-button @click="handleGetSelectData" class="mr-2"> 获取选中数据 </a-button>
<a-button @click="handleGetSelectNode" class="mr-2"> 获取选中节点 </a-button> <a-button @click="handleGetSelectNode" class="mr-2"> 获取选中节点 </a-button>
<a-button @click="handleGetTreeData" class="mr-2"> 获取Tree数据 </a-button>
<a-button @click="handleSetExpandData" class="mr-2"> 设置展开数据 </a-button> <a-button @click="handleSetExpandData" class="mr-2"> 设置展开数据 </a-button>
<a-button @click="handleGetExpandData" class="mr-2"> 获取展开数据 </a-button> <a-button @click="handleGetExpandData" class="mr-2"> 获取展开数据 </a-button>
</div> </div>
@ -118,6 +118,11 @@
}); });
} }
function handleGetTreeData() {
const treeDataRef = getTree().getTreeData();
createMessage.success(JSON.stringify(treeDataRef.value));
}
return { return {
treeData, treeData,
treeRef, treeRef,
@ -134,6 +139,7 @@
updateNodeByKey, updateNodeByKey,
checkAll, checkAll,
expandAll, expandAll,
handleGetTreeData,
}; };
}, },
}); });