SOURCE

console 命令行工具 X clear

                    
>
console
var Main = {
    data() {
        return {
            tableData: [],
            gridOptions: {
                border: true,
                showFooter: true,
                height: 300,
                columns: [
                    { type: 'seq', width: 360, fixed: 'left', align: 'center' },
                    { field: 'name', title: 'Name', width: 360, fixed: 'left', align: 'center' },
                    { field: 'sex', title: 'Sex', width: 360, align: 'center' },
                    { field: 'date', title: 'Date', width: 360, align: 'center' },
                    { field: 'time', title: 'Time', width: 360, align: 'center' },
                    { field: 'address', title: 'Address', width: 360, align: 'center' }
                ],
                data: [],
                footerMethod({ columns, data }) {
                    return [
                        columns.map((column, columnIndex) => {
                            if (columnIndex === 0) {
                                return `合计 ${data.length}`;
                            }
                            return `${columnIndex}`;
                        }),
                    ];
                },
            }
        }
    },
    mounted() {
        var list1 = []
        var list2 = []
        for (var index = 0; index < 130; index++) {
            list1.push({
                name: 'test' + index,
                role: 'developer',
                sex: 'Man',
                date: '2019-05-01',
                time: 1556677810888 + index * 500,
                region: 'ShenZhen',
                address: 'address abc' + index
            })
            list2.push({
                name: 'test' + index,
                role: 'developer',
                sex: 'Man',
                date: '2019-05-01',
                time: 1556677810888 + index * 500,
                region: 'ShenZhen',
                address: 'address abc' + index
            })
        }
        this.tableData = list1
        this.gridOptions.data = list2
    }
};

Vue.createApp(Main).use(VXETable).mount('#app')
<script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
<script src="https://cdn.jsdelivr.net/npm/xe-utils"></script>
<script src="https://cdn.jsdelivr.net/npm/vxe-table@next"></script>
<!-- 使用 cdn 引用方式需要注意是否锁定版本,默认指向最新版本 -->

<div id="app">
    <div>
      <!-- <p>Table 演示</p>
      <vxe-table
        border
        :data="tableData">
        <vxe-column type="seq" width="60"></vxe-column>
        <vxe-column field="name" title="Name"></vxe-column>
        <vxe-column field="sex" title="Sex"></vxe-column>
        <vxe-column field="date" title="Date"></vxe-column>
        <vxe-column field="address" title="Address"></vxe-column>
      </vxe-table>  -->
      <p>Grid 演示</p>
      <vxe-grid v-bind="gridOptions"></vxe-grid>
    </div>
</div>
@import url("https://cdn.jsdelivr.net/npm/vxe-table@next/lib/style.css");