<template>
<div id="nav" class="app-container">
<div class="search-container">
<el-button type="primary" icon="el-icon-download">导出</el-button>
</div>
<div class="table-wrapper">
<el-table
id="table"
ref="listTable"
:height="tableHeight + 'px'"
:data="table"
:header-cell-style="{ background: '#f8fbfc' }"
border
stripe
>
<el-table-column prop="order_num" label="订单编号" width="210" />
<el-table-column prop="remark" label="订单备注" align="center" width="160" :show-overflow-tooltip="true" />
</el-table>
</div>
<!-- 分页 -->
<pagination :total="tableTotal" :limit="listQuery.page_size" :page="listQuery.page_index" />
</div>
</template>
<script>
export default {
data() {
return {
listQuery: {
page_index: 1,
page_size: 20,
},
tableTotal: 0,
table: [],
tableHeight: 0,
}
},
created() {
},
mounted() {
this.$nextTick(() => {
this.tableHeight = document.getElementsByClassName('table-wrapper')[0].offsetHeight
})
},
methods: {
}
}
</script>
<style lang="scss" scoped>
#nav {
display: flex;
flex-direction: column;
height: calc(100vh - 84px); // 减去header高度
}
.table-wrapper {
width: 100%;
flex: 1;
}
.search-container {
margin: 5px 0;
button{
margin-right: 10px;
}
}
</style>
vue表格 一屏显示完
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 前端工作中,这是一个相当常见的技术点。既然现在工作涉及到了,就好好学习,作好记录,应用于工作中吧~ 一,假设数据 ...
- Android Studio 有一个很好的功能 在你关掉项目后 会记录你窗口的位置 大小 等下次打开的时...
- 我在表格中引用控件 发现星星评分渲染错误,分页也是使用的默认的,但是第一页的数据一直遍历两次才会遍历第二页的数据...
- 目标:在表格中,A列的数据显示不同,B列根据A列中不同的数据,再显示不同的按钮。如图: 分析一下,“状态”这一列,...