大屏组件

This commit is contained in:
yanran200730
2023-03-08 17:16:03 +08:00
parent 452952670b
commit 341643a87e

View File

@@ -5,7 +5,9 @@
v-for="(item, index) in header" v-for="(item, index) in header"
:key="index" :key="index"
:style="{ :style="{
width: item.width + 'px', flex: item.width ? 'inherit' : 1}"> width: item.width + 'px',
flex: item.width ? 'inherit' : 1
}">
{{ item.v }} {{ item.v }}
</span> </span>
</div> </div>
@@ -75,12 +77,13 @@
}) })
this.header = value.map(v => { this.header = value.map(v => {
console.log((Number(v.width)))
return { return {
v: v[headerKey], v: v[headerKey],
width: v.width || '' width: Number(v.width || 0) ? (Number(v.width || 0) + (this.isShowIndex === '1' ? 0 : 0)) : ''
} }
}) })
console.log(this.header)
this.body = bodyKey.map(v => { this.body = bodyKey.map(v => {
return value.map(e => { return value.map(e => {
return { return {
@@ -125,7 +128,7 @@
.body { .body {
height: calc(100% - 40px); height: calc(100% - 40px);
padding: 10px 12px; padding: 10px 20px;
overflow-y: auto; overflow-y: auto;
box-sizing: border-box; box-sizing: border-box;
.row { .row {