节点重构

This commit is contained in:
2025-02-12 14:21:19 +08:00
parent 977722f2c2
commit fb3b97fd30
3 changed files with 25 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-container>
<el-aside>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" style="margin-bottom: 10px" clearable />
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" style="margin-bottom: 10px" clearable/>
<el-tree class="filter-tree" :data="groupList" @node-click="nodeClick" node-key="id" highlight-current :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree" :default-expanded-keys="[0]">
<span class="custom-tree-node" slot-scope="{ node, data }" v-if="groupState !== 'list' && editId === data.id">
<span>
@@ -102,8 +102,10 @@ export default {
});
if (res.data && res.data.length > 0) {
this.groupId = res.data[0].id;
this.$refs.tree.setCurrentKey(this.groupId);
this.$emit('click', this.groupId);
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.groupId);
this.$emit('click', this.groupId);
})
}
})
},