Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix: 问题列表页返回首页再进入时重新拉取数据
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jul 5, 2018
1 parent 1cdf9e9 commit f447464
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/page/question/QuestionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,12 @@ export default {
}
},
watch: {
$route(newRoute, oldRoute) {
$route(to, from) {
if (
newRoute.path === oldRoute.path &&
newRoute.query.type !== oldRoute.query.type
) {
(to.path === from.path && to.query.type !== from.query.type) ||
!from.query.type // 后退再进入时重新拉取数据
)
this.fetchQuestions();
}
}
},
mounted() {
Expand Down

0 comments on commit f447464

Please sign in to comment.