Commit cf8db42c authored by Jenny's avatar Jenny

feat: table border

parent f405a929
...@@ -55,17 +55,17 @@ ...@@ -55,17 +55,17 @@
}, },
computed: { computed: {
tableStyle() { tableStyle() {
const { frameStyle, frameWidth, frameColor } = this.elementInfo.table const { frameStyle, frameWidth, frameColor, bordered } = this.elementInfo.table
const { backgroundColor } = this.elementInfo.table.tableCell const { backgroundColor } = this.elementInfo.table.tableCell
return { return {
'width': `${240 * this.columns.length}rpx`, 'width': `${240 * this.columns.length}rpx`,
'border-left': `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`, 'border-left': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none',
'border-top': `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`, 'border-top': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none',
'background-color': backgroundColor 'background-color': backgroundColor
} }
}, },
thStyle() { thStyle() {
const { frameStyle, frameWidth, frameColor } = this.elementInfo.table const { frameStyle, frameWidth, frameColor, bordered } = this.elementInfo.table
const { headerRowHeight, titleColor, backgroundColor, titlePostion, titleFontSize } = this.elementInfo.table.tableHeader const { headerRowHeight, titleColor, backgroundColor, titlePostion, titleFontSize } = this.elementInfo.table.tableHeader
return { return {
'lineHeight': `${headerRowHeight}px`, 'lineHeight': `${headerRowHeight}px`,
...@@ -73,12 +73,12 @@ ...@@ -73,12 +73,12 @@
'background-color': backgroundColor, 'background-color': backgroundColor,
'font-size': `${this.$u.common.pxToRpx(titleFontSize)}rpx`, 'font-size': `${this.$u.common.pxToRpx(titleFontSize)}rpx`,
'text-align': titlePostion || 'center', 'text-align': titlePostion || 'center',
'border-bottom': `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`, 'border-bottom': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none',
'border-right': `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}` 'border-right': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none'
} }
}, },
tdStyle() { tdStyle() {
const { frameStyle, frameWidth, frameColor } = this.elementInfo.table const { frameStyle, frameWidth, frameColor, bordered } = this.elementInfo.table
const { titlePostion, titleFontSize, cellRowHeight, titleColor } = this.elementInfo.table.tableCell const { titlePostion, titleFontSize, cellRowHeight, titleColor } = this.elementInfo.table.tableCell
return { return {
'text-align': titlePostion, 'text-align': titlePostion,
...@@ -86,8 +86,8 @@ ...@@ -86,8 +86,8 @@
'font-size': `${titleFontSize || 14}px`, 'font-size': `${titleFontSize || 14}px`,
'lineHeight': `${cellRowHeight || 30}px`, 'lineHeight': `${cellRowHeight || 30}px`,
'color': titleColor, 'color': titleColor,
'border-bottom': `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`, 'border-bottom': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none',
'border-right': `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}` 'border-right': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none'
} }
} }
}, },
......
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