1.0.1 • Published 1 month ago

crazyloader-nuxt v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

CrazyLoader - Nuxt

Node.js Package

Axios plugin for nuxt 2 to show Crazy Loading animation

This is just a regular plugin I made to display loading with a "percent animation" automatically. Created because the projects I work on often use Vuetify2 and Nuxt2. So instead of me making a "board loader" component for axios, yeah I think making this isn't too much haha. If you want to try it, make sure your project uses nuxt version 2 and vuetify version 2.

Features

  • Show loading with Vuetify's v-progress-circular component
  • Displays an overlay when the loader is displayed so the user cannot do "crazy" activities :)
  • Customizable Size, Position, Color
  • When axios makes a request, crazyloader will become "crazy" :)
  • Well, that's all.

Installastion

Make sure the @nuxtjs/axios plugin and @nuxtjs/vuetify is ready.

npm i crazyloader-nuxt

Load as a plugin in nuxt.config.js configuration

export default {
  // ...
  plugins: [
    // ...
    "~/node_modules/crazyloader-nuxt/@vuetify",
    // ..
  ],
  // ...
};

Usage

Example of usage in layout

layouts/default.vue

<template>
    <v-app>
        <!-- CrazyLoader component -->
        <crazy-loader />

        <v-main>
            <!-- Main -->
            <v-container fluid class="pt-0">
                <nuxt />
            </v-container>
        </v-main>
    </v-app>
</template>

<script>
export default {
    created() {
        // Sample axios request to show "CrazyLoader"
        this.crazyRequest().then((r) => {
            console.log(r.data)
        })
    },

    methods: {
        crazyRequest() {
            return this.$axios.get('https://dummyjson.com/products')
        }
    }
}
</script>

Props

OptionsTypeDefaultDescripion
rotatestring/number360Rotate value
sizestring/numver100Size value
widthstring/number15Width value
colorstring#d6f037Color value
zIndexstring/number9999999z-index style value

<crazy-loader
  rotate="360"
  size="100"
  width="15"
  color="#d6f037"
  z-index="9999999"
/>

Contributing

Just pull request :)

1.0.1

1 month ago

1.0.0

1 month ago