0.0.8 • Published 4 years ago

large-list v0.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Install

// npm
npm install large-list

// yarn
yarn add large-list

Usage

import LargeList from 'large-list';

Vue.component('LargeList', LargeList);
<LargeList>
    <PostCard>
    </PostCard>
</LargeList>

子组件需要提供heightChange事件,并且将新的高度newHeight,以及自身的id作为事件参数。

export default {
    name: 'PostCard',
    mounted() {
        this.$emit('heightChange', newHeight, id);
    },
}

API

LargeList Component

Props

interface PersistenceOptions {
    metaMap: MetaMap;
    startIndex: nuumber;
    endIndex: number;
    containerHeight: number;
}

keytyperequireddefaultdescription
listListItem[]truedata list
defaultItemHeightnumberfalse100default height of list item
defaultItemGapnumberfalse10 default gap width of two list item
preloadHeightnumberfalse200预先检测的高度
persistence(PersistenceOptions) => voidfalse当传入persistence时,将尝试向persistence传入这些需要存储的数据
load() => PersistenceOptionsfalse当传入load时,将尝试通过load函数获取之前存储的数据

Event


namedescription

Roadmap:

  1. 考虑将render中的scopeSlots替换成事件逻辑
0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago