pagingTable.vue
1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<div>
<el-table :data="data" border v-loading="loading" v-bind="$attrs" v-on="$listeners">
<lb-column v-bind="$attrs" v-for="(item, index) in column" :key="index" :column="item">
</lb-column>
</el-table>
<el-pagination class="lb-table-pagination" v-if="pagination" :page-sizes="[10, 20, 50, 100]"
layout="total, prev, pager, next, jumper" :style="{
'margin-top': '16px',
'text-align': 'right',
}" v-bind="$attrs" v-on="$listeners" :pager-count="6" @current-change="paginationCurrentChange">
</el-pagination>
</div>
</template>
<script>
import LbColumn from "@/components/LbTable/lb-column";
export default {
components: { LbColumn },
props: {
data: Array,
column: Array,
pagination: {
type: Boolean,
default: true,
},
},
methods: {
paginationCurrentChange (val) {
this.$emit("current-change", val);
},
},
};
</script>
<style rel="stylesheet/less" lang="less" scoped>
</style>