fix:修复文件树点击选择文件后连续调用两次请求问题

This commit is contained in:
czhqwer
2025-04-06 13:33:03 +08:00
parent f1d66a2e7a
commit 3223d3fd6c

View File

@@ -4,7 +4,6 @@
<div class="input-section">
<SelectDir
v-model="directoryPath"
@change="handlePathChange"
:showFiles="false"
style="width: 300px; margin-right: 10px;"
/>
@@ -88,6 +87,11 @@ export default {
};
},
watch: {
directoryPath(newVal) {
if (newVal) {
this.fetchFileTree();
}
},
filterText(val) {
this.$refs.tree.filter(val);
this.$nextTick(() => {
@@ -105,10 +109,6 @@ export default {
},
},
methods: {
handlePathChange(path) {
this.directoryPath = path;
this.fetchFileTree();
},
async fetchFileTree() {
if (!this.directoryPath) {
this.$message.warning('请选择目录路径');