Commit a58c0053 authored by 郭志伟's avatar 郭志伟

fix: 定位问题修复

parent 861e9654
<template> <template>
<div class="Pb-container"> <div class="Pb-container" :style="bgColor">
<span class="Pb-text" :style="style">{{ txt }}</span> <span class="Pb-text" :style="style">{{ txt }}</span>
</div> </div>
</template> </template>
...@@ -16,6 +16,12 @@ export default { ...@@ -16,6 +16,12 @@ export default {
return { return {
color: this.pageData.props.pageBottomColor color: this.pageData.props.pageBottomColor
}; };
},
// TODO 这样不太好
bgColor() {
return {
'backgroundColor': this.pageData.commonStyle.backgroundColor
};
} }
} }
} }
...@@ -24,6 +30,7 @@ export default { ...@@ -24,6 +30,7 @@ export default {
.Pb { .Pb {
&-container { &-container {
height: 60px; height: 60px;
width: 100%;
text-align: center; text-align: center;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -14,7 +14,7 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) { ...@@ -14,7 +14,7 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
@Prop(Boolean) isDraging; @Prop(Boolean) isDraging;
@Prop(Boolean) isDragIn; @Prop(Boolean) isDragIn;
layout: object = [];
bottomInfo: object = { bottomInfo: object = {
x: 0, x: 0,
y: 0, y: 0,
...@@ -23,10 +23,13 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) { ...@@ -23,10 +23,13 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
i: 'page-bottom-top' i: 'page-bottom-top'
}; };
@Watch('pageData') get layout() {
return this.pageData.elements.map(v => v.point);
}
@Watch('layout')
onLayoutChange(val) { onLayoutChange(val) {
const layout = this.pageData.elements.map(v => v.point); const lastGridItemPoint = val[val.length - 1];
const lastGridItemPoint = layout[layout.length - 1];
if (lastGridItemPoint.w) { if (lastGridItemPoint.w) {
this.bottomInfo = { this.bottomInfo = {
x: 0, x: 0,
...@@ -38,8 +41,6 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) { ...@@ -38,8 +41,6 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
if (lastGridItemPoint.w > this.bottomInfo.w) { this.bottomInfo.w = lastGridItemPoint.w; } if (lastGridItemPoint.w > this.bottomInfo.w) { this.bottomInfo.w = lastGridItemPoint.w; }
this.bottomInfo.y = this.bottomInfo.y + lastGridItemPoint.y + lastGridItemPoint.h; this.bottomInfo.y = this.bottomInfo.y + lastGridItemPoint.y + lastGridItemPoint.h;
} }
layout.push(this.bottomInfo);
this.layout = layout;
} }
@Emit('update:isDragIn') @Emit('update:isDragIn')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment