Commit 13215129 by jml0128

fix

1 parent 37760168
{
"name": "xrk-bi",
"version": "0.1.10",
"version": "0.1.11",
"description": "xrk-bi",
"author": "xrk",
"main": "dist/bundler.js",
......
......@@ -56,6 +56,7 @@
:key="index"
class="bi-cover_input"
:class="{ [item.className]: true, drag: drag }"
:ref="item.className"
:style="{
left: `${item.pos.left}px`,
top: `${item.pos.top}px`,
......@@ -235,7 +236,24 @@ export default {
const { name, pos } = arr[index];
name && (item.name = name);
try {
pos && (item.pos = JSON.parse(pos));
if (pos) {
item.pos = JSON.parse(pos);
} else if (item.className === 'bi-cover_date') {
// 如果是时间的初始位置
try {
const dom = document.createElement('div');
dom.style.width = '690px';
dom.style.fontSize = '66px';
dom.style.lineHeight = '80px';
dom.style.wordBreak = 'break-all';
dom.innerHTML = arr[0].name;
document.body.appendChild(dom);
item.pos.top += dom.offsetHeight - 250;
document.body.removeChild(dom);
} catch (error) {
console.log(error);
}
}
} catch (error) {
console.warn(error);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!