From bf46dbbbc1a869fcd8e7257057b9320ee8b937e7 Mon Sep 17 00:00:00 2001
From: Goldennfish <1981343953@qq.com>
Date: 星期二, 25 七月 2023 14:22:36 +0800
Subject: [PATCH] 第一次修改标准库的Tree
---
src/views/standardLibrary/index.vue | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/views/standardLibrary/index.vue b/src/views/standardLibrary/index.vue
index c4c5ce5..b5876fb 100644
--- a/src/views/standardLibrary/index.vue
+++ b/src/views/standardLibrary/index.vue
@@ -14,6 +14,7 @@
:props="defaultProps"
default-expand-all
:filter-node-method="filterNode"
+ :render-content="renderContent"
@node-click="nodeClick"
/>
</div>
@@ -618,6 +619,24 @@
await updateSpeState({ id: this.rowId,
spe_state: '0' })
this.dialogFormVisible5 = false
+ },
+ renderContent(h, { node, data, store }) {
+ // console.log('data', data)
+ // console.log('node', node)
+ // 鍒ゆ柇鏄惁鏄埗鑺傜偣鎴栨枃浠跺す
+ const isFolder = ('children') in data
+ return (
+ <span>
+ {isFolder ? (
+ <i
+ class={node.expanded ? 'el-icon-folder-opened blue-folder' : 'el-icon-folder blue-folder'}
+ ></i>
+ ) : (
+ <i class='el-icon-document blue-folder'></i>
+ )}
+ <span> {data.label}</span>
+ </span>
+ )
}
}
}
@@ -649,6 +668,16 @@
margin-right: 12px;
.el-tree {
// margin-top: 12px;
+ ::v-deep .el-tree-node__content{
+ height: 24px !important;
+ font-size: 16px;
+ display: inline-block !important;
+ padding: 2px;
+ color: #333;
+ .blue-folder{
+ color: rgb(64, 158, 255)
+ }
+ }
}
// .el-tree {
// margin-top: 12px;
--
Gitblit v1.9.3