Skip to content

Commit

Permalink
add quick filter table for author, series
Browse files Browse the repository at this point in the history
remove trash
  • Loading branch information
ufaboy committed Jan 28, 2024
1 parent 0f73b30 commit b8f6b38
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lib-vue",
"private": true,
"version": "1.5.3",
"version": "1.5.4",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
32 changes: 0 additions & 32 deletions replaceEngToCyrLetters.js

This file was deleted.

14 changes: 10 additions & 4 deletions src/views/BookTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { RATINGS, SIZES } from '@/utils/constants';
import TablePaginator from '@/components/TablePaginator.vue';
import SkeletonTableRow from '@/components/SkeletonTableRow.vue';
import TheLoader from '@/components/TheLoader.vue';
import { QueryBooks } from '@/interfaces/book';
document.title = 'Books';
Expand Down Expand Up @@ -71,6 +72,11 @@ function updateLimit(size: number) {
getBooks();
}
function setFilterUpdateList(filter: QueryBooks) {
queryBooks.value = filter
getBooksByFilter();
}
watch(
() => shortColumns,
(newValue) => {
Expand Down Expand Up @@ -535,14 +541,14 @@ if (!series.value) getSeries({ perPage: 100, sort: 'name' });
</span>
</td>
<td class="td">
<span :class="{ hidden: shortColumns.includes('author') }">
<button :class="{ hidden: shortColumns.includes('author') }" @click="setFilterUpdateList({...queryBooks, authorName: book.author?.name})">
{{ book.author?.name }}
</span>
</button>
</td>
<td class="td">
<span :class="{ hidden: shortColumns.includes('series') }">
<button :class="{ hidden: shortColumns.includes('series') }" @click="setFilterUpdateList({...queryBooks, seriesName: book.series?.name})">
{{ book.series?.name }}
</span>
</button>
</td>
<td class="td text-center">
<span :class="{ hidden: shortColumns.includes('length') }">
Expand Down

0 comments on commit b8f6b38

Please sign in to comment.