mirror of
https://gitee.com/czh-dev/upload-hub
synced 2026-09-05 07:27:21 +08:00
fix:修复文件树点击选择文件后连续调用两次请求问题
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
<div class="input-section">
|
<div class="input-section">
|
||||||
<SelectDir
|
<SelectDir
|
||||||
v-model="directoryPath"
|
v-model="directoryPath"
|
||||||
@change="handlePathChange"
|
|
||||||
:showFiles="false"
|
:showFiles="false"
|
||||||
style="width: 300px; margin-right: 10px;"
|
style="width: 300px; margin-right: 10px;"
|
||||||
/>
|
/>
|
||||||
@@ -88,6 +87,11 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
directoryPath(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.fetchFileTree();
|
||||||
|
}
|
||||||
|
},
|
||||||
filterText(val) {
|
filterText(val) {
|
||||||
this.$refs.tree.filter(val);
|
this.$refs.tree.filter(val);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -105,10 +109,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePathChange(path) {
|
|
||||||
this.directoryPath = path;
|
|
||||||
this.fetchFileTree();
|
|
||||||
},
|
|
||||||
async fetchFileTree() {
|
async fetchFileTree() {
|
||||||
if (!this.directoryPath) {
|
if (!this.directoryPath) {
|
||||||
this.$message.warning('请选择目录路径');
|
this.$message.warning('请选择目录路径');
|
||||||
|
|||||||
Reference in New Issue
Block a user