vue ant desgin 中 table自动高度
<template>
<div>
<a-page-header
style="border: 1px solid rgb(235, 237, 240)"
title="发货单"
sub-title="12"
@back="() => null"
> </a-page-header>
<div class="table-operations">
<a-button-group>
<a-button @click="this.ShowImportWin=true" type="primary"><a-icon type="file-excel" />导入</a-button>
<a-button @click="this.ShowCreateWin=true"><a-icon type="plus" />手工新增</a-button>
<a-button @click="this.ShowBoCiHeBingWin=true"><a-icon type="file-zip" />波次合并</a-button>
</a-button-group>
</div>
<a-table :columns="columns" :data-source="data" :scroll="tableheight" >
<a-button-group slot="action" >
<a-button size="small" ><a-icon type="printer" />打印</a-button>
<a-button size="small" type="danger" > <a-icon type="delete" />删除</a-button>
</a-button-group>
</a-table>
</div>
</template>
<script>
const columns = [
{
title: 'Full Name', width: 100, dataIndex: 'name', key: 'name', fixed: 'left' },
{
title: 'Age', width: 100, dataIndex: 'age', key: 'age', fixed: 'left' },
{
title: 'Column 1', dataIndex: 'address', key: '1', width: 150 },
{
title: 'Column 2', dataIndex: 'address', key: '2', width: 150 },
{
title: 'Column 3', dataIndex: 'address', key: '3', width: 150 },
{
title: 'Column 4', dataIndex: 'address', key: '4', width: 150 },
{
title: 'Column 5', dataIndex: 'address', key: '5', width: 150 },
{
title: 'Column 6', dataIndex: 'address', key: '6', width: 150 },
{
title: 'Column 7', dataIndex: 'address', key: '7', width: 150 },
{
title: 'Column 8', dataIndex: 'address', key: '8', width: 150 },
{
title: '操作',
key: 'operation',
fixed: 'right',
width: 200,
scopedSlots: {
customRender: 'action' },
},
];
const data = [];
for (let i = 0; i < 100; i++) {
data.push({
key: i,
name: `Edrward ${
i}`,
age: 32,
address: `London Park no. ${
i}`,
});
}
export default {
data() {
return {
tableheight:{
x: 1500, y: document.body.clientHeight - 250 },//250 是其它元素的固定高度
ShowImportWin:false,
ShowCreateWin:false,
ShowBoCiHeBingWin:false,
data,
columns,
};
},
name: 'FaHuoTongZhiDan',
props: {
msg: String
}
}
</script>