Files
vxe-table/examples/views/table/optimize/Scroller.vue
xuliangzhan 6aefefa030 update
2019-08-06 14:43:06 +08:00

16 lines
930 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<p class="red">问题现象当表格数据量较大时由于数据量越大表格的渲染就会越慢</p>
<p>Vue 响应机制由于 vue 会对数据源进行 set / get 双向绑定所以对于数据量海量的情况下耗时会很久</p>
<p class="red">问题所在数据量过大页面渲染 Element 节点太多导致页面卡顿</p>
<p>优化方案1如果数据量超大 200+ 通过<router-link class="link" :to="{name: 'TableScroll'}">虚拟滚动方式</router-link>按需加载比如将数组拆分成可视区 100 由于只渲染了可视区所以渲染会很快</p>
<p>优化方案2不要使用数据源的双向绑定使用函数式的 loadData / reloadData 进行数据加载可以跳过 vue 的双向绑定这对于大数据量提升很大</p>
</div>
</template>
<style lang="scss" scoped>
p {
font-size: 16px;
}
</style>