Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Coffcer/vue-loading

vue1 directive, show loading block in any element
https://github.com/Coffcer/vue-loading

Last synced: 3 months ago
JSON representation

vue1 directive, show loading block in any element

Awesome Lists containing this project

README

        

# vue-loading

> Vue directive for show loading block in any element.

[Live demo and usage](http://coffcer.github.io/vue-loading/)

Build by [vue-cli](https://github.com/vuejs/vue-cli) and [vue-cli-component](https://github.com/Coffcer/component)

## Usage

General usage
```vue

import loading from 'vue-loading';
export default {
directives: { loading },
data () {
return { isLoading: false }
}
}



```

You can also use `vue-loading` with vue-router [$loadingRouteData](http://vuejs.github.io/vue-router/en/pipeline/data.html#details)
```vue

export default {
router: {
data (transition) {
// the vue-loading is show.

window.setTimeout(() => {
// the vue-loading will closed after next().
transition.next();
}, 3000);
}
}
}

```

## Options

**text:**
* loading block text
* default value: "Loading ..."

**bg:**
* loading block backgroundColor css,
* default value: "rgba(230, 233, 236, 0.8)"