Декомпозиция, выделен AuthorList

This commit is contained in:
Book Pauk
2022-10-24 16:51:27 +07:00
parent 63dfdaf2c2
commit bc2a54c4ab
5 changed files with 995 additions and 825 deletions

View File

@@ -85,7 +85,7 @@ class BookView {
_options = componentOptions;
_props = {
book: Object,
genreTree: Array,
genreMap: Object,
showAuthor: Boolean,
showReadLink: Boolean,
titleColor: { type: String, default: 'text-blue-10'},
@@ -140,12 +140,12 @@ class BookView {
get bookGenre() {
let result = [];
const genre = new Set(this.book.genre.split(','));
const genre = this.book.genre.split(',');
for (const section of this.genreTree) {
for (const g of section.value)
if (genre.has(g.value))
result.push(g.name);
for (const g of genre) {
const name = this.genreMap.get(g);
if (name)
result.push(name);
}
return `(${result.join(' / ')})`;