瀏覽代碼

Calculate pageCount on all passwords not filtered passwords

Fixes https://github.com/lesspass/lesspass/issues/693
tags/pure-v9.5.6
Guillaume Vincent 2 年之前
父節點
當前提交
43a4c946b4
共有 1 個檔案被更改,包括 11 行新增11 行删除
  1. +11
    -11
      packages/lesspass-pure/src/views/Passwords.vue

+ 11
- 11
packages/lesspass-pure/src/views/Passwords.vue 查看文件

@@ -90,18 +90,18 @@ export default {
pagination: {
pageCount: 1,
perPage: 5,
currentPage: 1
}
currentPage: 1,
},
};
},
components: {
PasswordProfile,
Paginate
Paginate,
},
computed: {
...mapState(["passwords"]),
filteredPasswords() {
const passwords = this.passwords.filter(password => {
const passwords = this.passwords.filter((password) => {
var loginMatch = password.login.match(
new RegExp(this.searchQuery, "i")
);
@@ -113,17 +113,17 @@ export default {
this.pagination.perPage,
this.pagination.currentPage * this.pagination.perPage
);
}
},
},
watch: {
filteredPasswords: {
deep: true,
handler: function(newVal) {
handler: function () {
this.pagination.pageCount = Math.ceil(
newVal.length / this.pagination.perPage
this.passwords.length / this.pagination.perPage
);
}
}
},
},
},
beforeMount() {
this.$store.dispatch("getPasswords");
@@ -131,7 +131,7 @@ export default {
methods: {
setCurrentPage(page) {
this.pagination.currentPage = page;
}
}
},
},
};
</script>

Loading…
取消
儲存