@opensig/opendesign
Version:
79 lines (78 loc) • 2.1 kB
JavaScript
const virtualListProps = {
/**
* @zh-CN 默认滚动到第几项
* @en-US Default scroll index
* @default 0
*/
defaultStartIndex: {
type: Number,
default: 0
},
/**
* @zh-CN 列表数据,如果数据存在动态追加,需要每一项需包含唯一ID
* @en-US List data, if dynamic addition exists, each item must contain a unique ID
*/
list: {
type: Array,
required: true,
default: () => []
},
/**
* @zh-CN 每一项的高度。传数字为定高模式;传函数为按项定高模式(函数接收 item 和 index 参数);不传为不定高模式(运行时测量)
* @en-US Height of each item. Number for fixed height; function for per-item height (receives item and index); undefined for dynamic height (measured at runtime)
* @since 1.2.6
*/
itemSize: {
type: [Number, Function]
},
/**
* @zh-CN 不定高时,每一项的默认高度
* @en-US If the height of each item is not consistent, the default height of each item
* @default 80
*/
defaultItemSize: {
type: Number,
default: 80
},
/**
* @zh-CN 前后预留项,减少滚动式空白
* @en-US Front and back reserved items, reducing scrolling blank
* @default 1
*/
buffer: {
type: Number,
default: 1
},
/**
* @zh-CN scrollbar配置项
* @en-US scrollbar configuration item
* @default true
*/
scrollbar: {
type: [Boolean, Object],
default: true
},
/**
* @zh-CN 布局方向,'vertical' 为垂直滚动,'horizontal' 为水平滚动
* @en-US Layout direction, 'vertical' for vertical scrolling, 'horizontal' for horizontal scrolling
* @default 'vertical'
* @since 1.2.6
*/
layout: {
type: String,
default: "vertical"
},
/**
* @zh-CN 数据量阈值,低于此值不启用虚拟化;null 表示始终启用
* @en-US Data count threshold, below which virtualization is disabled; null means always enabled
* @default null
* @since 1.2.6
*/
threshold: {
type: Number,
default: null
}
};
export {
virtualListProps
};