pagingTable.vue 1.09 KB
<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>