Commit c0f28d01 by 李嘉林

文本组件

parent b3c5586e
...@@ -3,18 +3,20 @@ ...@@ -3,18 +3,20 @@
<template> <template>
<div class="text-text"> <div class="text-text">
<p <p
:style="{ :style="{
'word-breakword-break':'break-all', 'word-breakword-break':'break-all',
'color':getfontsizeColor, 'color':getfontsizeColor,
'background-color':getbackgroundColor, 'background-color':getbackgroundColor,
'padding-top':getPaddingList[0]['value']+'px', 'padding-top':getPaddingList[0]['value']+'px',
'padding-bottom':getPaddingList[1]['value']+'px', 'padding-bottom':getPaddingList[1]['value']+'px',
'padding-left':getPaddingList[2]['value']+'px', 'padding-left':getPaddingList[2]['value']+'px',
'padding-right':getPaddingList[3]['value']+'px', 'padding-right':getPaddingList[3]['value']+'px',
'textAlign':getAlign, 'textAlign':getAlign,
'fontSize':getFontSize}" 'line-height':lineHeight,
@click="itemClick" 'fontSize':getFontSize
>{{getContent}}</p> }"
@click="itemClick()"
>{{getContent}}</p>
</div> </div>
</template> </template>
...@@ -101,8 +103,17 @@ export default { ...@@ -101,8 +103,17 @@ export default {
return this.datas.componentData.backgroundColor; return this.datas.componentData.backgroundColor;
} }
}, },
customSize () {
return this.datas.componentData.customSize || 12;
},
lineHeight () {
return this.datas.componentData.lineHeight || 1;
},
getFontSize() { getFontSize() {
if (this.datas.componentData) { if (this.datas.componentData) {
if(this.datas.componentData.initcharSize == 0) {
return this.customSize + "px";
}
return this.datas.componentData.initcharSize + "em"; return this.datas.componentData.initcharSize + "em";
} }
} }
......
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