Giter Club home page Giter Club logo

large-list's Introduction

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


key type description
list ListItem[] 列表数据
defaultItemHeight number 每项元素的默认高度
defaultItemGap number 两个列表元素之间的间隔
preloadHeight number 预先检测的高度
persistence ({ metaMap: MetaMap, startIndex: nuumber, endIndex: number, containerHeight: number }) => void 当传入persistence时,将尝试向persistence传入这些需要存储的数据
load void 当传入load时,将尝试通过load函数获取之前存储的数据

Roadmap:

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

large-list's People

Contributors

dependabot[bot] avatar forzoom avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.