Giter Club home page Giter Club logo

load-more-list's Introduction

加载更多列表组件

GIF

图片3

NPM

npm install load-more-list --save
yarn add load-more-list

import

import { LoadMoreList } from 'load-more-list';
export default {
  components:{ LoadMoreList }
}

API

export default {
  name: 'LoadMoreList',
  emits: ['load-more'], //加载更多事件
  props: {
    //是否有更多列表项
    hasMore: {
      type: Boolean,
      default: true,
    },
    //加载中
    loading: {
      type: Boolean,
      default: false,
    },
    //mount时自动加载
    loadOnMounted: {
      type: Boolean,
      default: true,
    },
    //加载的占位符
    skeletonCount: {
      type: Number,
      default: 3,
    },
    //触发加载时距离底部的距离
    bottomThreshold: {
      type: Number,
      default: 100,
    },
    //没有更多的文字
    noMoreText: String,
    //加载更多文字
    loadMoreText: String,
  },
}

SLOTS

  • skeleton 完全替换加载占位,默认包含skeletonCount个skeleton-item

    props:

    • loading 是否加载中
  • skeleton-item 占位item替换

    props:

  • footer 完全替换footer,默认包含loading,no-more,load-more三个插槽

    props:

    • hasMore 是否还有
    • loading 是否加载中
    • clickLoadMore 触发加载方法
  • loading 替换loading

    props:

    • hasMore 是否还有
    • loading 是否加载中
  • no-more 替换no-more

    props:

    • hasMore 是否还有
    • loading 是否加载中
  • load-more 替换load-more

    props:

    • hasMore 是否还有
    • loading 是否加载中
    • clickLoadMore 触发加载方法

Versions

0.0.1:

  • 引入tailwindcss来处理样式

0.0.2

  • tailwindcss移到开发依赖

load-more-list's People

Contributors

apm29 avatar

Stargazers

 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.