fix: 修复搜索组件的历史搜索中同一条搜索语句点击第二次不能填充搜索框的问题

This commit is contained in:
刘洪洪
2023-12-29 11:57:45 +08:00
parent 1f33834146
commit f40e9ae759
3 changed files with 5 additions and 4 deletions

View File

@@ -205,8 +205,9 @@ export default {
this.$emit('search', { q: '', str: '', metaList: [] }) this.$emit('search', { q: '', str: '', metaList: [] })
} }
}, },
focus () { focus (e) {
this.codeMirror.focus() toRaw(this.codeMirror).setValue(e.str)
// this.codeMirror.focus()
}, },
changeMode () { changeMode () {
const str = this.codeMirror.getValue().trim() const str = this.codeMirror.getValue().trim()

View File

@@ -191,7 +191,7 @@ export default {
this.showHistory = false this.showHistory = false
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.search.$refs.textMode) { if (this.$refs.search.$refs.textMode) {
this.$refs.search.$refs.textMode.focus() this.$refs.search.$refs.textMode.focus(row)
} }
}) })
if (this.showList) { if (this.showList) {

View File

@@ -130,7 +130,7 @@ export default {
this.showHistory = false this.showHistory = false
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.search.$refs.textMode) { if (this.$refs.search.$refs.textMode) {
this.$refs.search.$refs.textMode.focus() this.$refs.search.$refs.textMode.focus(row)
} }
}) })
if (this.showList) { if (this.showList) {