# v-loading-directive

> Vue directive for display loading indicator.

Latest version **1.0.4** (published 2022-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install v-loading-directive
pnpm add v-loading-directive
yarn add v-loading-directive
bun add v-loading-directive
```

## 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.4 |
| Published | 2022-03-11 |
| First published | 2022-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jorge Deeline |
| Maintainers | jdeeline |
| Keywords | vue, directive, loading |

## Links

- npm: https://www.npmjs.com/package/v-loading-directive
- Repository: https://github.com/jdeeline/v-loading-directive
- Issues: https://github.com/jdeeline/v-loading-directive/issues
- npm.io page: https://npm.io/package/v-loading-directive

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.x || ^3.x

## Recent versions

- 1.0.4 (latest) — 2022-03-11
- 1.0.3 — 2022-03-10
- 1.0.2 — 2022-03-10
- 1.0.1 — 2022-03-10

## README

# v-loading-directive

![NPM Downloads](https://img.shields.io/npm/dt/v-loading-directive)

A simple loading indicator for your Vue project.

## Usage

First, register the directive.

```javascript
// globally
import Vue from 'vue';
import VLoading from 'v-loading-directive';

Vue.directive('loading', VLoading);

// or locally
import loading from 'v-loading-directive';

export default {
  directives: {
    loading,
  },
};
```

Then add `v-loading` attribute to element, passing a boolean value.

```vue
<template>
  <div v-loading="isLoading">...some content...</div>
</template>

<script>
export default {
  data() {
    return {
      isLoading: true,
    };
  },
};
</script>
```

## Customization

You can use CSS variables to customize spinner color and size.

```vue
<template>
  <div v-loading="isLoading" class="content">...some content...</div>
</template>

<style scoped>
.content {
  --v-loading-color: red;
  --v-loading-size: 4em;
}
</style>
```

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