|
|
@@ -12,7 +12,7 @@
|
|
|
|
|
|
<div class="introduction-search">
|
|
|
<img src="@/assets/image/introductionCloudPhone/search.png" alt="" />
|
|
|
- <input v-model="searchText" type="search" placeholder="请输入应用名" />
|
|
|
+ <input ref="inputField" v-model="searchText" type="search" placeholder="请输入应用名" />
|
|
|
<div @click="search">搜索</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -80,6 +80,18 @@ export default {
|
|
|
components: { layout, layoutBack },
|
|
|
created() {
|
|
|
this.getSuggestApp()
|
|
|
+
|
|
|
+ let _this = this
|
|
|
+ document.addEventListener('keydown', function (e) {
|
|
|
+ // 检查是否是搜索键(通常是“Enter”键)
|
|
|
+ if (e.keyCode === 13) { // Enter key
|
|
|
+ // 执行搜索操作
|
|
|
+ _this.search();
|
|
|
+
|
|
|
+ // 调用原生方法隐藏软键盘
|
|
|
+ _this.$refs.inputField.blur();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
watch: {
|
|
|
searchText(value) {
|
|
|
@@ -203,7 +215,7 @@ export default {
|
|
|
float: right;
|
|
|
text-align: center;
|
|
|
border-radius: 8px;
|
|
|
- margin: 4px 4px 0 0 ;
|
|
|
+ margin: 4px 4px 0 0;
|
|
|
}
|
|
|
}
|
|
|
|