Giter Site home page Giter Site logo

vue-eternal-loading's Introduction

πŸ‡ΊπŸ‡¦ vue-eternal-loading Build Status

The Infinity loading component is written in TypeScript for Vue 3. No dependencies.

Features:

  • 4 directional ( top / left / right / bottom)
  • 4 loading states ( loading / no-more / no-results / error )
  • Custom markup & styles
  • Works in browsers & bundlers
  • SSR friendly

Installation:

Yarn

yarn add @ts-pro/vue-eternal-loading

Npm

npm install @ts-pro/vue-eternal-loading

Browser

<head>
    <!-- Vue 3 must be loaded before `vue-eternal-loading` -->
    <script src="https://cdn.jsdelivr.net/gh/ts-pro/vue-eternal-loading/dist/vue-eternal-loading.umd.js"></script>
</head>

Simple usage:

<VueEternalLoading :load="load"></VueEternalLoading>
const PAGE_SIZE = 5;

// We need to pass this method to the component,
// and it will be called automatically when needed.
async function load({ loaded }) {
  // Load your data from the server or any other source.
  const loadedItems = await loadItems(page);
  items.value.push(...loadedItems);
  page += 1;
  // Call the `loaded` callback with 2 arguments:
  // 1. The number of items we have loaded
  // 2. Our page size to know when we have reached the end
  loaded(loadedItems.length, PAGE_SIZE);
}

Guide & demo:

Check out our vue-eternal-loading docs

Releases

List releases vue-eternal-loading releases

Vue2 support

Our component is specifically designed for Vue 3. If you are looking for a solution for Vue 2, you can check out this library vue-infinite-loading.

Issue

Please feel free to create an issue or submit a feature request vue-eternal-loading issues

License

MIT License

vue-eternal-loading's People

Contributors

faenir avatar gavrashenko avatar ms-mayya 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.