# vue-component-loading-screen

> a simple plugin for show an indicator when your component is busy.

Latest version **1.0.2** (published 2019-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-component-loading-screen
pnpm add vue-component-loading-screen
yarn add vue-component-loading-screen
bun add vue-component-loading-screen
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-03-04 |
| First published | 2019-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Oğuz Sert |
| Maintainers | oguzsert |
| Keywords | vue, loading |

## Links

- npm: https://www.npmjs.com/package/vue-component-loading-screen
- Repository: https://github.com/oguzsert/vue-component-loading-screen
- Homepage: https://github.com/oguzsert/vue-component-loading-screen#readme
- Issues: https://github.com/oguzsert/vue-component-loading-screen/issues
- npm.io page: https://npm.io/package/vue-component-loading-screen

## Recent versions

- 1.0.2 (latest) — 2019-03-04
- 1.0.1 — 2019-03-04
- 1.0.0 — 2019-03-02

## README

# VUE-COMPONENT-LOADING-SCREEN PLUGIN


Vue Component Loading screen is a simple plugin for show an indicator when your component is busy.

  - You can activate/disable loading screens manually
  - You can bind your screen states to [Axios].

### Installation

```sh
$ npm install vue-component-loading-screen
```

### Demonstration page
```sh
$ npm run serve
```
### Implementation

```javascript
import Vue from 'vue'
import App from './App.vue'
import VueComponentLoadingScreenPlugin from "vue-component-loading-screen";
import "vue-component-loading-screen/vue-component-loading-screen.css";

Vue.use(VueComponentLoadingScreenPlugin,{
  loadingImage:"[YOUR LOADING IMAGE PATH]", //-> Required
  overlayBackgroundColor:"rgba(0,0,0,0.3)" //-> Optional (RGB OR HEX)
});
```

### Manual Screen Activation
```javascript
export default {
  name: 'HelloWorld',
  methods:{
      exampleMethod(){
          this.COMPONENT_IS_BUSY(); //->Activates loading screen
          /*
          Bunch of code doing something.
          ..................
          ..............................
          .........................................
          */
          this.COMPONENT_IS_IDLE(); // -> Disables loading screen
      }
  }
}
```

### Binding Screen States To Axios Instance
Loading screen activates before request sent and disables when response received or error occured.
```javascript
import axios from "axios";
export default {
  name: 'HelloWorld',
  methods:{
    sendAjax(){
        var yourAxiosInstance = axios.create({
              baseURL: '[SOME API PATH]'
        });
        this.bindLoadingScreenToAxios(yourAxiosInstance);
        yourAxiosInstance();
    }
  }
}
```
### OPTIONS
Option | Description | Is Required | Default Value
------------ | ------------- | ------------- | -------------
loadingImage | Path of your loading image | true | -
overlayBackgroundColor | Loading screen background color. You can set HEX or RGB value | false | rgba(0,0,0,0.5)
License
----

MIT

---
_Source: https://npm.io/package/vue-component-loading-screen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
