npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sadrix-vue-page-loader

v1.1.3

Published

Simple customizeable page loader component with self state manager module for Vue.js.

Downloads

23

Readme

⌛️ Sadrix Vue Page Loader ⏳

Simple customizeable page loader component with self state manager module for Vue.js.

github repository

Please let me know what you think about this package. Don't forget to report bugs.

🎉 version 1 released 🎈


First steps

1. Instalation

Install package in your project with this command

npm i -S sadrix-vue-page-loader

2. Import

Import package inside your Vuejs application config file and let you global Vue instance use it as a plugin.

The only important notice is this plugin use Vuex package as state manager and you need to import this package first and config it, then pass you store param as an option property with name of store (with small s) and plugin will automaticaly add needed mutaction, states and actions under namespace of pageLoader.

import SadrixPageLoader from 'sadrix-page-loader';
import Vue from 'vue';
import store from './store/store';
import router from './core/router';
import Page from './layouts/page';

// Let Vue use our plugin
Vue.use(SadrixPageLoader, { store });

// Create app
new Vue({
    el: '#app',
    router,
    store,
    render: h => h(Page)
});

3. Component

Your done! Now easily can use <page-loader/> component any where inside your application.

  • example: in your .vue template file
<div>
    <page-loader/>
</div>

4. customization

Yes! you can easily customize your page loader from your components attributes and passing props to component.

  • example: change color of loader
<div>
    <page-loader color="#ff5252"/>
</div>

🎨 Sadrix Vue Color

For faster and easier use of colors in js project we also publish an amasing Vue.js plugin. you can use it to pass colors in your project easily. Github npm

  • example: change height of page loader Please note you need to pass height prop as a Number (Don't forget : of height attr).
<div>
    <page-loader :height="3"/>
</div>
  • example: wow!😯 RTL support 😍 Its easy! just pass :rtl="true".
<div>
    <page-loader :rtl="true"/>
</div>

How to use

For faster and easier usage and control on this loader, We add some custom property to Vue main module. You just need to call showPageLoader(timeout) when want loader show and how much it take (timeout) to fill window width in milisecounds (optionl). default timeout is 10 secounds or 10000ms. And when you want to hide loader easily type hidePageLoader().

  • example: show/hide page loader for and api request
<script>
import axios from 'axios';

export default {
    methods: {
        callApi() {
            // for example before making request we want
            // to show the page loader and max in 6 secounds timeout
            this.$showPageLoader();

            // make request
            axios.get('https://someurl.com')
                // on success
                .then(data => {
                    // here we hide page loader
                    this.$hidePageLoader();
                })
                // on error
                .catch(error => {
                    // here we hide page loader
                    this.$hidePageLoader();
                });
        }
    }
}
</script>

build your amasing app with a beautiful page loader! 😉