This commit is contained in:
nextfu
2022-07-26 20:05:42 +08:00
parent 65d90e20b9
commit 6aeca4583e
5 changed files with 40 additions and 32 deletions

View File

@@ -12,7 +12,11 @@ let showTree = ref(false);
</vue-final-modal>
<el-button size="small" @click="showTree = !showTree">节点树</el-button>
</div> -->
<TreePanel :show="true" style="border: 2px solid blue;"></TreePanel>
<!-- <div style="width: 100%;border: 2px solid blue;"> -->
<el-card :body-style="{ padding: 0 }" style="margin: 10px;">
<TreePanel :show="true"></TreePanel>
</el-card>
<!-- </div> -->
</template>
<style scoped>

View File

@@ -4,14 +4,16 @@
class="modal-drag">
节点树
</div> -->
<el-tree-v2 ref="treeView" :props="defaultProps" empty-text="正在加载场景" :highlight-current="true"
:expand-on-click-node="false" :default-expanded-keys="expandedKeys" @current-change="handleCurrentNodeChange"
@node-expand="handleNodeExpand" @node-collapse="handleNodeCollapse" :height="treeViewHeight">
<template #default="{ node }">
<span :class="{ 'node-hide': !node.data.active }">{{ node.label }}</span>
</template>
</el-tree-v2>
<div style="width: 100%;border-top: 2px solid #1d1e21;overflow: auto;" :style="{ height: treeViewHeight }">
<div style="width: 100%;" :style="{ height: treeViewHeight }">
<el-tree-v2 ref="treeView" :props="defaultProps" empty-text="正在加载场景" :highlight-current="true"
:expand-on-click-node="false" :default-expanded-keys="expandedKeys" @current-change="handleCurrentNodeChange"
@node-expand="handleNodeExpand" @node-collapse="handleNodeCollapse" :height="treeViewHeight">
<template #default="{ node }">
<span :class="{ 'node-hide': !node.data.active }">{{ node.label }}</span>
</template>
</el-tree-v2>
</div>
<div style="width: 100%;border-top: 2px solid #414243;" :style="{ height: treeViewHeight }">
<template v-if="updateKey !== 0 && Utils.checkNodeValid(currentNode)">
<el-scrollbar>
<CCNode :cc-node="currentNode" :update-key="updateKey"></CCNode>
@@ -58,7 +60,7 @@ const defaultProps = {
children: 'children',
};
const treeViewHeight = window.innerHeight * 0.4;
const treeViewHeight = (window.innerHeight - 120) / 2;
const treeView = ref(null);
onMounted(() => {