1.页面
<form action="" @submit.prevent="onRefresh">
<input
type="search"
@keyup.13="onTextareaKeyDown"
ref="searchInput"
placeholder="请输入关键词"
v-model="page.keyword"
/>
</form>
2.直接调用刷新方法
onRefresh() {
this.refreshing = true;
this.loading = true;
this.finished = false;
this.page.pageNumber = 1;
this.fetchData();
},
3.收起软键盘
onTextareaKeyDown() {
this.$refs.searchInput.blur();
// this.onRefresh();
},