Работа над BookInfoDialog

This commit is contained in:
Book Pauk
2022-11-10 18:57:20 +07:00
parent 7b2171c269
commit d7d04fcda8
2 changed files with 120 additions and 33 deletions

View File

@@ -54,9 +54,7 @@
<div style="width: 110px">
{{ subItem.label }}
</div>
<div class="q-ml-sm">
{{ subItem.value }}
</div>
<div class="q-ml-sm" v-html="subItem.value" />
</div>
</div>
@@ -246,7 +244,22 @@ class BookInfoDialog {
//fb2
if (bookInfo.fb2) {
this.fb2 = parser.bookInfoList(bookInfo.fb2);
this.fb2 = parser.bookInfoList(bookInfo.fb2, {
valueToString(value, nodePath) {//eslint-disable-line no-unused-vars
if (nodePath == 'documentInfo/historyHtml' && value)
return value.replace(/<p>/g, `<p class="p-history">`);
if (typeof(value) === 'string') {
return value;
} else if (Array.isArray(value)) {
return value.join(', ');
} else if (typeof(value) === 'object') {
return JSON.stringify(value);
}
return value;
},
});
const infoObj = parser.bookInfo(bookInfo.fb2);
if (infoObj.titleInfo) {
@@ -282,4 +295,9 @@ export default vueComponent(BookInfoDialog);
padding: 0;
margin: 0;
}
.p-history {
padding: 0;
margin: 0;
}
</style>