Skip to content

Commit 20e4280

Browse files
committed
修复在探索页面中第一次按下回车无反应问题
1 parent c85a0f0 commit 20e4280

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/views/explore/index.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export default {
123123
sort = parseInt(fSort)
124124
keyword = fKeyword
125125
prep = fPrep
126-
console.log(p2b.decode(f))
127126
}
128127
this.searchForm = { sort, prep, keyword }
129128
this.page = page
@@ -141,12 +140,13 @@ export default {
141140
switchRoute() {
142141
// 切换路由,如果没有name就只更新query查询信息
143142
const f = p2b.encode({ ...this.searchForm, page: this.page })
144-
if (this.$route.query.f === f) {
145-
this.getInstance()
146-
} else {
143+
if (this.$route.query.f !== f) {
147144
const routeObj = { name: 'Explore', query: { f } }
148-
this.$router.push(routeObj).catch((err) => err)
145+
this.$router.push(routeObj).catch((err) => {
146+
console.log(err)
147+
})
149148
}
149+
this.getInstance()
150150
},
151151
search() {
152152
this.$refs.searchField.blur()
@@ -161,6 +161,7 @@ export default {
161161
this.searchLoading = true
162162
this.listLoading = true
163163
this.nothing = false
164+
this.showNothingTip = false
164165
this.init = true
165166
const prepKey = judgeMode(prep)
166167
const res = await this.$http.searchWorksByContent({

0 commit comments

Comments
 (0)