fix(视图-echarts表格): 修复序号列宽度调整无效
This commit is contained in:
parent
3e5218216a
commit
0f5ce0d67c
@ -41,6 +41,7 @@
|
|||||||
<ux-table-column
|
<ux-table-column
|
||||||
type="index"
|
type="index"
|
||||||
:title="indexLabel"
|
:title="indexLabel"
|
||||||
|
:width="columnWidth"
|
||||||
/>
|
/>
|
||||||
<ux-table-column
|
<ux-table-column
|
||||||
v-for="field in fields"
|
v-for="field in fields"
|
||||||
@ -302,8 +303,9 @@ export default {
|
|||||||
// column width
|
// column width
|
||||||
const containerWidth = this.$refs.tableContainer.offsetWidth
|
const containerWidth = this.$refs.tableContainer.offsetWidth
|
||||||
const columnWidth = attr.size.tableColumnWidth ? attr.size.tableColumnWidth : this.columnWidth
|
const columnWidth = attr.size.tableColumnWidth ? attr.size.tableColumnWidth : this.columnWidth
|
||||||
if (columnWidth < (containerWidth / this.fields.length)) {
|
const fieldsLength = attr.size.showIndex ? this.fields.length + 1 : this.fields.length
|
||||||
this.columnWidth = containerWidth / this.fields
|
if (columnWidth < (containerWidth / fieldsLength)) {
|
||||||
|
this.columnWidth = containerWidth / fieldsLength
|
||||||
} else {
|
} else {
|
||||||
this.columnWidth = columnWidth
|
this.columnWidth = columnWidth
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user