xiaocheng555 / a-virtual-table Goto Github PK
View Code? Open in Web Editor NEW基于Ant-Design-Vue的 Table 组件开发的虚拟滚动组件,支持动态高度,解决数据量大时滚动卡顿的问题。
基于Ant-Design-Vue的 Table 组件开发的虚拟滚动组件,支持动态高度,解决数据量大时滚动卡顿的问题。
<a slot="name" slot-scope="text">{{ text }}</a>
<span slot="customTitle"><a-icon type="smile-o" /> Name</span>
columns = [
{
dataIndex: 'name',
key: 'name',
slots: { title: 'customTitle' },
scopedSlots: { customRender: 'name' },
}]
<template v-for="slot in Object.keys($scopedSlots)" :slot="slot" slot-scope="text"> <slot :name="slot" v-bind="typeof text === 'object' ? text : {text}"></slot> </template>
应该改成:
<template v-for="slot in Object.keys($scopedSlots)" :slot="slot" slot-scope="text, record, index"> <slot :name="slot" v-bind="{text, record, index}"></slot> </template>
在列少情况下。没有X滚动条。列就会对不齐
columns: [
{
title: '#',
index: true,
width:60,
},
{
title:'唯一码',
align:"center",
dataIndex: 'prodUnicode',
width:280,
scopedSlots: {
filterDropdown: 'filterProdUnicode'
},
},
{
title:'数量',
align:"center",
width:60,
dataIndex: 'qty'
},
{
title:'sku代码',
align:"center",
width:200,
dataIndex: 'skuCode'
},
{
title:'商品代码',
align:"center",
width:100,
dataIndex: 'prodCode'
},
{
title:'款号',
align:"center",
width:100,
dataIndex: 'prodModel'
},
{
title:'名称',
align:"center",
width:150,
dataIndex: 'prodName'
},
{
title:'属性',
align:"center",
width:250,
dataIndex: 'skuValues'
},
{
title: '操作',
align:"center",
fixed:"right",
width:60,
scopedSlots: { customRender: 'action' },
}
]
slot-scope="text” 只能获取到 text ,无法获取record 我的操作列都无法使用了
我现在有个需求,使用 antd 的 table, 但数据量太大了,所以也想用虚拟滚动效果,请问下有什么思路吗?样式和框架还是想使用 antd 的 css。
key:'rowIndex', 行号会不对 有办法解决问题吗
customRender function (t,r,index) {
return parseInt(index)+1;
}
目前过滤的数据不是全量的,只能过滤可视区域内的数据
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.