el-table显示数据量大导致页面卡顿问题优化

使用背景

使用el-table,页面显示几百上千条数据的时候十分卡顿。

实现内容

  1. 使用umy-ui组件(umy-ui官网),解决数据量大卡顿的问题。

解决方法

  1. 安装
npm install umy-ui
  1. 引入
<script>
	 import Vue from 'vue';
	 import UmyUi from 'umy-ui'
	 import 'umy-ui/lib/theme-chalk/index.css';// 引入样式
	 import App from './App.vue';
	
	 Vue.use(UmyUi);
	
	 new Vue({
	   el: '#app',
	   render: h => h(App)
	 });
</script>
  1. 使用
    增加:row-height=“32” use-virtual属性
 <u-table ref="productionTable" :row-height="32" use-virtual v-loading="table.loading" :data="table.tableData" show-body-overflow="tooltip" highlight-current-row height="480" @selection-change="handleSelectionChange">
	<u-table-column type="selection" width="44" align="center" fixed></u-table-column>
	<u-table-column label="代号" prop="11111" align="left" min-width="120px" show-overflow-tooltip>
		<template slot-scope="scope">
			<span>{{ scope.row.11111|| '-' }}</span>
		</template>
	</u-table-column>
</u-table>
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值