vue ant desgin 中 table自动高度

11 篇文章 0 订阅

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>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值