console
var Main = {
data() {
return {
tableData: [],
gridOptions: {
border: true,
columns: [
{ type: 'seq', width: 60 },
{ field: 'name', title: 'Name' },
{ field: 'sex', title: 'Sex' },
{ field: 'date', title: 'Date' },
{ field: 'address', title: 'Address' }
],
data: []
}
}
},
created() {
var list1 = []
var list2 = []
setTimeout(() => {
for (var index = 0; index < 500; index++) {
list1.push({
name: 'test' + index,
role: 'developer',
sex: 'Man',
date: '2019-05-01',
time: 1556677810888 + index * 500,
region: 'ShenZhen',
address: 'address abcwfwfwefwfeasdasdasdasdaasdsad' + 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
}, 300)
}
};
Vue.createApp(Main).use(VXETable).mount('#app')
<script src="https://unpkg.com/vue@3.5.13"></script>
<script src="https://unpkg.com/xe-utils"></script>
<script src="https://unpkg.com/vxe-pc-ui@4.3.95"></script>
<script src="https://unpkg.com/vxe-table@4.11.11"></script>
<div id="app">
<div>
<p>Table 演示</p>
<vxe-table
border
:scroll-y="{ enabled: true,gt:1 }"
height='500'
:data="tableData">
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="name" title="Name" width="500"></vxe-column>
<vxe-column field="sex" title="Sex" width="500"></vxe-column>
<vxe-column field="date" title="Date" width="500"></vxe-column>
<vxe-column field="address" title="Address" fixed='right' width="100"></vxe-column>
</vxe-table>
</div>
</div>
@import url("https://unpkg.com/vxe-pc-ui@4.3.95/lib/style.css");
@import url("https://unpkg.com/vxe-table@4.11.11/lib/style.css");