mirror of
https://gitee.com/czh-dev/upload-hub
synced 2026-05-06 20:32:48 +08:00
fix:修复文件树点击选择文件后连续调用两次请求问题
This commit is contained in:
@@ -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('请选择目录路径');
|
||||
|
||||
Reference in New Issue
Block a user