Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit 6d4d934

Browse files
author
Ken Berkeley
committed
[fix] Advanced: th-Filter should reset pagination each time
1 parent 76dd210 commit 6d4d934

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

examples/src/Advanced/comps/th-Filter.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ export default {
3232
},
3333
methods: {
3434
search () {
35+
const { query } = this
3536
// `$props.query` is set to `{ limit: 10, offset: 0, sort: '', order: '' }` by default
3637
// custom query fields must be set to observable by `Vue.set / $vm.$set` manually
37-
this.$set(this.query, this.field, this.keyword)
38+
this.$set(query, this.field, this.keyword)
39+
query.offset = 0 // reset pagination
3840
}
3941
}
4042
}

examples/src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ export default {
6464
showTab: getCurHash() || 'basic'
6565
}),
6666
mounted () {
67-
$(window).on('hashchange', () => this.showTab = getCurHash())
67+
$(window).on('hashchange', () => {
68+
this.showTab = getCurHash()
69+
console.clear()
70+
})
6871
}
6972
}
7073
</script>

0 commit comments

Comments
 (0)