Commit cc04d582 authored by Xuguangxing's avatar Xuguangxing

feat: 处理高度与内边距的计算方式

parent 7c89aaa3
...@@ -37,7 +37,8 @@ export default class TransformStyleMixin extends Vue { ...@@ -37,7 +37,8 @@ export default class TransformStyleMixin extends Vue {
const eleId = element.getAttribute('id'); const eleId = element.getAttribute('id');
const component = this.pageData.elements.find(v => v.id === eleId); const component = this.pageData.elements.find(v => v.id === eleId);
if (!component) { return; } if (!component) { return; }
const point = { ...component.point, h: component.name === 'cs-goods-tabs' ? Math.floor(+height) : Math.ceil(+height) }; const calcHeight = +height + (component.commonStyle.paddingTop || 0) + (component.commonStyle.paddingBottom || 0);
const point = { ...component.point, h: component.name === 'cs-goods-tabs' ? Math.floor(+calcHeight) : Math.ceil(+calcHeight) };
this.setElementPoint({ id: eleId, data: point }); this.setElementPoint({ id: eleId, data: point });
console.log('adjustHeight', height, component, element.getAttribute('id'), point); console.log('adjustHeight', height, component, element.getAttribute('id'), point);
......
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