Skip to content

Commit 9493f07

Browse files
author
reco_luan
committed
fix: build error
1 parent 8379b4c commit 9493f07

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

layouts/Category.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export default {
5353
computed: {
5454
// 时间降序后的博客列表
5555
posts () {
56-
this._setPage(this._getStoragePage())
5756
let posts = this.$currentCategories.pages
5857
posts = this._filterPostData(posts)
5958
this._sortPostData(posts)
@@ -66,6 +65,7 @@ export default {
6665
},
6766
6867
mounted () {
68+
this._setPage(this._getStoragePage())
6969
this.recoShow = true
7070
},
7171
@@ -90,6 +90,12 @@ export default {
9090
_getTimeNum (date) {
9191
return parseInt(new Date(date.frontmatter.date).getTime())
9292
}
93+
},
94+
95+
watch: {
96+
$route () {
97+
this._setPage(this._getStoragePage())
98+
}
9399
}
94100
}
95101
</script>

layouts/Tag.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default {
4444
computed: {
4545
// 时间降序后的博客列表
4646
posts () {
47-
this._setPage(this._getStoragePage())
4847
let posts = this.$currentTags.pages
4948
posts = this._filterPostData(posts)
5049
this._sortPostData(posts)
@@ -53,6 +52,7 @@ export default {
5352
},
5453
5554
mounted () {
55+
this._setPage(this._getStoragePage())
5656
this.recoShow = true
5757
},
5858
@@ -76,6 +76,12 @@ export default {
7676
this.$page.currentPage = page
7777
this._setStoragePage(page)
7878
}
79+
},
80+
81+
watch: {
82+
$route () {
83+
this._setPage(this._getStoragePage())
84+
}
7985
}
8086
}
8187
</script>

0 commit comments

Comments
 (0)