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

fix: 定位问题修复

parent 861e9654
<template>
<div class="Pb-container">
<div class="Pb-container" :style="bgColor">
<span class="Pb-text" :style="style">{{ txt }}</span>
</div>
</template>
......@@ -16,6 +16,12 @@ export default {
return {
color: this.pageData.props.pageBottomColor
};
},
// TODO 这样不太好
bgColor() {
return {
'backgroundColor': this.pageData.commonStyle.backgroundColor
};
}
}
}
......@@ -24,6 +30,7 @@ export default {
.Pb {
&-container {
height: 60px;
width: 100%;
text-align: center;
display: flex;
align-items: center;
......
......@@ -14,7 +14,7 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
@Prop(Boolean) isDraging;
@Prop(Boolean) isDragIn;
layout: object = [];
bottomInfo: object = {
x: 0,
y: 0,
......@@ -23,10 +23,13 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
i: 'page-bottom-top'
};
@Watch('pageData')
get layout() {
return this.pageData.elements.map(v => v.point);
}
@Watch('layout')
onLayoutChange(val) {
const layout = this.pageData.elements.map(v => v.point);
const lastGridItemPoint = layout[layout.length - 1];
const lastGridItemPoint = val[val.length - 1];
if (lastGridItemPoint.w) {
this.bottomInfo = {
x: 0,
......@@ -38,8 +41,6 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
if (lastGridItemPoint.w > this.bottomInfo.w) { this.bottomInfo.w = lastGridItemPoint.w; }
this.bottomInfo.y = this.bottomInfo.y + lastGridItemPoint.y + lastGridItemPoint.h;
}
layout.push(this.bottomInfo);
this.layout = layout;
}
@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