diff --git a/frontend/src/components/ModalUi.vue b/frontend/src/components/ModalUi.vue index 9b0e3bb4..d7300d2c 100644 --- a/frontend/src/components/ModalUi.vue +++ b/frontend/src/components/ModalUi.vue @@ -57,7 +57,7 @@ export default { this.resolve = resolve }) }, - input ({ type, title, hint, value, content }) { + input ({ type, title, hint, value, content, select = true }) { this.type = 'input' this.title = title || '请输入' this.content = content || '' @@ -68,7 +68,13 @@ export default { this.show = true this.$nextTick(() => { this.$refs.input.focus() - this.$refs.input.select() + + if (select) { + this.$refs.input.select() + if (Array.isArray(select)) { + this.$refs.input.setSelectionRange(...select) + } + } }) return new Promise(resolve => { diff --git a/frontend/src/components/TreeNode.vue b/frontend/src/components/TreeNode.vue index 35d52545..500a26aa 100644 --- a/frontend/src/components/TreeNode.vue +++ b/frontend/src/components/TreeNode.vue @@ -99,7 +99,8 @@ export default { title: '移动文件', hint: '新的路径', content: '当前路径:' + this.item.path, - value: this.item.path + value: this.item.path, + select: [this.item.path.lastIndexOf('/') + 1, this.item.path.length, 'forward'] }) if (!newPath) {