소스 검색

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>

불러오는 중...
취소
저장