diff --git a/nezha-fronted/src/components/common/searchBox/searchBox.vue b/nezha-fronted/src/components/common/searchBox/searchBox.vue index dcdd95704..0a211b124 100644 --- a/nezha-fronted/src/components/common/searchBox/searchBox.vue +++ b/nezha-fronted/src/components/common/searchBox/searchBox.vue @@ -94,6 +94,7 @@ load: valueListLoad, hasMore: (valueShow && valueList.length)&&(valueListInfo.total > valueList.length), }" + @mousedown="mousedownSearchBox" >
@@ -128,7 +129,7 @@ {{$t('overall.noDataAvailable')}}
-
{{$t('searchBox.enterNext')}}
+
{{$t('searchBox.enterNext')}}
@@ -907,7 +908,7 @@ export default { this.oldSearchStr = '' } this.visible = false - this.$refs.searchStr.blur() + this.$refs.searchStr && this.$refs.searchStr.blur() this.$emit('search', obj) }) }, 100), @@ -1038,7 +1039,7 @@ export default { inputEnd () { // 光标最后一位 const ele = this.$refs.searchStr.$el const obj = ele.getElementsByClassName('el-input__inner')[0] - obj.focus() + this.$refs.searchStr.focus() const len = obj.value.length if (document.selection) { const sel = obj.createTextRange() @@ -1212,6 +1213,9 @@ export default { return arr.find(enumItem => enumItem.value === item).label }) return value + }, + mousedownSearchBox (event) { + event.preventDefault() } }, watch: {