Commit b4fc2b26 by jml0128

Merge branch 'develop' into 'release'

Develop

See merge request !16
2 parents 134333f6 9c4b8c2a
{ {
"name": "xrk-bi", "name": "xrk-bi",
"version": "0.3.0-beta.10", "version": "0.3.0-beta.11",
"description": "xrk-bi", "description": "xrk-bi",
"author": "xrk", "author": "xrk",
"main": "dist/bundler.js", "main": "dist/bundler.js",
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
* @Author: jml * @Author: jml
* @Date: 2021-03-24 10:22:27 * @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2022-04-27 20:29:19 * @LastEditTime: 2022-04-29 12:27:09
--> -->
<template> <template>
<div> <div>
<BiBlank height="40" :usePrint="true"></BiBlank> <BiBlank height="40" :usePrint="true"></BiBlank>
<div class="bi-article" v-html="content"></div> <div class="bi-article" v-html="_content"></div>
<BiBlank height="40" :usePrint="true"></BiBlank> <BiBlank height="40" :usePrint="true"></BiBlank>
</div> </div>
</template> </template>
...@@ -28,6 +28,18 @@ export default { ...@@ -28,6 +28,18 @@ export default {
default: '' default: ''
} }
}, },
computed: {
_content() {
return `${this.content}`.replace(
/((width)="(\d+)") ((height)="(\d+)")/g,
(...a) => {
return `style="width:1000px;height:${parseInt(
(a[6] * 1000) / a[3]
)}px;"`;
}
);
}
},
data() { data() {
return { return {
option: {} option: {}
...@@ -44,8 +56,7 @@ export default { ...@@ -44,8 +56,7 @@ export default {
img, img,
video { video {
width: 100%; width: 100%;
object-fit: contain; height: inherit;
height: 100%;
} }
} }
</style> </style>
...@@ -230,9 +230,13 @@ export default { ...@@ -230,9 +230,13 @@ export default {
className = 'print-item nowarp child-nowarp'; className = 'print-item nowarp child-nowarp';
} else { } else {
offsetHeight = this.getArticleHeight(0, $el); offsetHeight = this.getArticleHeight(0, $el);
pre.totalPage += offsetHeight > baseHeight * baseScale ? 1 : 0; // 玄学 pre.totalPage += 1;
className = 'print-item child-nowarp'; className = 'print-item child-nowarp';
} }
console.log(
offsetHeight,
parseInt(offsetHeight / (baseHeight * baseScale))
);
} }
const domUsePage = parseInt(offsetHeight / (baseHeight * baseScale)); const domUsePage = parseInt(offsetHeight / (baseHeight * baseScale));
if (this.printInfo) { if (this.printInfo) {
......
...@@ -606,6 +606,11 @@ export default { ...@@ -606,6 +606,11 @@ export default {
this.coverList = tempaletList.data.data || []; this.coverList = tempaletList.data.data || [];
this.$nextTick(async () => { this.$nextTick(async () => {
await this.preloadImg(this.coverUrl); await this.preloadImg(this.coverUrl);
// await Promise.all(
// [...document.querySelectorAll('img')].map(i =>
// this.preloadImg(i.src)
// )
// );
window.status = '1'; window.status = '1';
}); });
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!