mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
增加模态组件输入框选择范围功能
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user