@aochuang/client-sdk 1.0.373 → 1.0.375
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -117,6 +117,7 @@ export default {
|
|
|
117
117
|
},
|
|
118
118
|
methods: {
|
|
119
119
|
handleCloseClick () {
|
|
120
|
+
this.$emit('close')
|
|
120
121
|
this.closed = true
|
|
121
122
|
},
|
|
122
123
|
handleBodyScroll (evt) {
|
|
@@ -183,6 +184,12 @@ export default {
|
|
|
183
184
|
// 向下
|
|
184
185
|
if (evt.keyCode === 40) {
|
|
185
186
|
evt.preventDefault()
|
|
187
|
+
if (this.hasMore && !this.loadingMore && index >= this.data.length - 2) {
|
|
188
|
+
this.$emit('load-more')
|
|
189
|
+
}
|
|
190
|
+
if (this.hasMore && index === this.data.length - 1) {
|
|
191
|
+
return
|
|
192
|
+
}
|
|
186
193
|
const nextIndex = index + 1 > this.data.length - 1 ? 0 : index + 1
|
|
187
194
|
this.focusId = this.data[nextIndex].id
|
|
188
195
|
this.scrollTo(this.focusId)
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
:data="suggestionsData"
|
|
52
52
|
:confirm-method="handleSuggestionsConfirmMethod"
|
|
53
53
|
@closed="handleSuggestionsClosed"
|
|
54
|
+
@close="handleSuggestionsClose"
|
|
54
55
|
@load-more="handleSuggestionsLoadMore"
|
|
55
56
|
>
|
|
56
57
|
<template slot="item" slot-scope="scope">
|
|
@@ -138,6 +139,12 @@ export default {
|
|
|
138
139
|
this.suggestionsHasMore = false
|
|
139
140
|
this.suggestionsLoadingMore = false
|
|
140
141
|
},
|
|
142
|
+
handleSuggestionsClose () {
|
|
143
|
+
this.closeSuggestions()
|
|
144
|
+
this.suggestionsNearsetInfo = null
|
|
145
|
+
this.suggestionsData = []
|
|
146
|
+
this.suggestionsKeyword = null
|
|
147
|
+
},
|
|
141
148
|
handleSuggestionsConfirmMethod ({ item }) {
|
|
142
149
|
const next = () => {
|
|
143
150
|
if (!this.suggestionsNearsetInfo) {
|
|
@@ -275,6 +282,7 @@ export default {
|
|
|
275
282
|
this.suggestioning = true
|
|
276
283
|
this.suggestionsLoadingMore = false
|
|
277
284
|
this.suggestionsHasMore = false
|
|
285
|
+
this.suggestionsData = []
|
|
278
286
|
this.suggestionsKeyword = keyword
|
|
279
287
|
this.popoverActive = true
|
|
280
288
|
clearTimeout(this._loadSuggestionsTimer)
|