|
|
@@ -196,10 +196,18 @@ export default {
|
|
196
|
196
|
},
|
|
197
|
197
|
$route(to, from) {
|
|
198
|
198
|
// Check if we changed sort method
|
|
|
199
|
+ // from no sort to sorted
|
|
|
200
|
+ // or sorted to no sort
|
|
|
201
|
+ // or sort to a different sort(?)
|
|
199
|
202
|
console.log('to:', to.fullPath.includes(this.sortBy))
|
|
200
|
203
|
console.log('from:', from.fullPath.includes(this.sortBy))
|
|
201
|
204
|
console.log('sort:', this.sortBy)
|
|
202
|
|
- if(to.fullPath.includes(this.sortBy) || from.fullPath.includes(this.sortBy)) { this.clearAndInitPostList() }
|
|
|
205
|
+ if(
|
|
|
206
|
+ from.fullPath.includes(this.sortBy) ||
|
|
|
207
|
+ (!to.fullPath.includes(this.sortBy) && !from.fullPath.includes(this.sortBy))
|
|
|
208
|
+ ) {
|
|
|
209
|
+ this.clearAndInitPostList()
|
|
|
210
|
+ }
|
|
203
|
211
|
}
|
|
204
|
212
|
},
|
|
205
|
213
|
mounted() {
|