|
1 |
| -<p align="center"> |
2 |
| - <a href="https://github.com/coderdiaz/vue-status-indicator"> |
3 |
| - <img src="https://vuejs.org/images/logo.png" width="120"> |
4 |
| - </a> |
5 |
| - <h2 align="center"><vue-status-indicator /></h2> |
6 |
| -</p> |
7 |
| - |
8 |
| -<p align="center"> |
9 |
| -A Vue component to show status indicator as colored dots. <a href="https://coderdiaz.me/vue-status-indicator/">Demo</a>. This is a fork of <a href="https://github.com/tnhu/status-indicator">status-indicator</a> with a few changes for use with Vue.js. |
10 |
| -</p> |
11 |
| - |
12 |
| -<p align="center"> |
13 |
| - <a href="https://npmjs.com/package/vue-status-indicator"><img src="https://img.shields.io/npm/dt/vue-status-indicator.svg?style=flat-square"></a> |
14 |
| - <a href="https://github.com/coderdiaz/vue-status-indicator/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square"></a> |
15 |
| - <a href="https://github.com/coderdiaz/vue-status-indicator/stargazers"><img src="https://img.shields.io/github/stars/coderdiaz/vue-status-indicator.svg?style=flat-square"></a> |
16 |
| - <a href="http://npmjs.com/package/vue-status-indicator"><img src="https://img.shields.io/npm/v/vue-status-indicator.svg?style=flat-square"></a> |
17 |
| - <a href="http://npmjs.com/package/vue-status-indicator"><img src="https://img.shields.io/npm/dm/vue-status-indicator.svg?style=flat-square"></a> |
18 |
| - <a href="https://www.paypal.me/coderdiaz"><img src="https://img.shields.io/badge/invite-coffee-red.svg?style=flat-square"></a> |
19 |
| -</a> |
20 |
| - |
21 |
| ---- |
22 |
| - |
23 |
| - |
24 |
| - |
25 |
| -## Install |
26 |
| - |
27 |
| -```bash |
28 |
| -npm i -S vue-status-indicator |
29 |
| -``` |
30 |
| - |
31 |
| -### Donate |
| 1 | +# [Status Indicator](https://github.com/coderdiaz/vue-status-indicator) · [](http://npmjs.com/package/vue-status-indicator) [](https://github.com/coderdiaz/vue-status-indicator/stargazers) [](https://travis-ci.org/coderdiaz/vue-status-indicator) [](https://npmjs.com/package/vue-status-indicator) |
32 | 2 |
|
33 |
| -<a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/coderdiaz"><img src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:5px">Buy me a coffee</span></a> |
| 3 | +A Vue component to show a status indicator as colored dots. This is a fork of [status-indicator](https://github.com/tnhu/status-indicator) with a few changes for use it with Vue. |
34 | 4 |
|
35 |
| -## Usage |
36 |
| -Import status-indicator.css in your CSS or JavaScript. |
| 5 | +## Install/Usage |
| 6 | +<!-- Replace the docs for usage the plugin --> |
| 7 | +```sh |
| 8 | +# Install with npm |
| 9 | +$ npm i -S vue-status-indicator |
37 | 10 |
|
38 |
| -CSS: |
39 |
| - |
40 |
| -```css |
41 |
| -@import 'vue-status-indicator' |
| 11 | +# or yarn |
| 12 | +$ yarn add vue-status-indicator |
42 | 13 | ```
|
43 | 14 |
|
44 |
| -JavaScript: |
| 15 | +```html |
| 16 | +<div id="app"> |
| 17 | + <status-indicator status="active" /> |
| 18 | +</div> |
| 19 | +``` |
45 | 20 |
|
46 |
| -```javascript |
47 |
| -import 'vue-status-indicator/styles.css' |
| 21 | +You can use **Local Registration**: |
| 22 | +```js |
| 23 | +import { StatusIndicator } from 'vue-status-indicator'; |
| 24 | +new Vue({ |
| 25 | + el: '#app', |
| 26 | + components: { |
| 27 | + StatusIndicator, |
| 28 | + }, |
| 29 | +}); |
48 | 30 | ```
|
49 | 31 |
|
50 |
| -Import component `status-indicator`. |
| 32 | +or **Global Registration**: |
| 33 | +```js |
| 34 | +import StatusIndicator from 'vue-status-indicator'; |
| 35 | +Vue.use(StatusIndicator); |
51 | 36 |
|
52 |
| -```javascript |
53 |
| -import { StatusIndicator } from 'vue-status-indicator' |
| 37 | +// or with a custom component name |
| 38 | +import { StatusIndicator } from 'vue-status-indicator'; |
| 39 | +Vue.component('custom-name', StatusIndicator); |
54 | 40 | ```
|
55 | 41 |
|
56 |
| -HTML/Vue: |
| 42 | +### Usage in browser |
| 43 | +<!-- Write an example for use the plugin in browser from CDN --> |
| 44 | +In browser you can use Unpkg, Jsdelivr, CDN.js, etc. |
| 45 | +```sh |
| 46 | +# Unpkg |
| 47 | +https://unpkg.com/vue-status-indicator@latest/dist/vue-status-indicator.js |
57 | 48 |
|
58 |
| -```html |
59 |
| -<template> |
60 |
| - <status-indicator active pulse></status-indicator> |
61 |
| -</template> |
62 |
| -<script> |
63 |
| - import { StatusIndicator } from 'vue-status-indicator' |
64 |
| - export default { |
65 |
| - components: { |
66 |
| - StatusIndicator |
67 |
| - } |
68 |
| - } |
69 |
| -</script> |
| 49 | +# JSDelivr |
| 50 | +https://cdn.jsdelivr.net/npm/vue-status-indicator@latest/dist/vue-status-indicator.min.js |
70 | 51 | ```
|
71 | 52 |
|
72 |
| -Usage in Browser: |
73 |
| -``` |
74 |
| -https://unpkg.com/vue-status-indicator@latest/dist/vue-status-indicator.min.js |
75 |
| -https://unpkg.com/vue-status-indicator@latest/styles.css |
76 |
| -``` |
77 |
| -**Example**: https://jsfiddle.net/coderdiaz/k038cdf3/ |
| 53 | +### Supported Browsers |
| 54 | +Latest versions of Chrome/Firefox/Safari/IE/Opera. |
78 | 55 |
|
79 |
| -### API |
80 |
| - |
81 |
| -```html |
82 |
| -<status-indicator active|positive|intermediary|negative pulse></status-indicator> |
83 |
| -``` |
| 56 | +## Documentation |
| 57 | +<!-- Add all documentation about the plugin: props, events, etc --> |
| 58 | +### Props |
| 59 | +|Name|Description|Type|Default|Required| |
| 60 | +|---|---|---|---|---| |
| 61 | +|status|Status color for the dot|String|""|false| |
| 62 | +|pulse|Enable or disable the pulse effect|Boolean|false|false| |
84 | 63 |
|
| 64 | +### Customatization |
85 | 65 | You are able to customize the dot by CSS variables, default configuration is listed below.
|
86 | 66 |
|
87 | 67 | ```css
|
@@ -111,26 +91,8 @@ You are able to customize the dot by CSS variables, default configuration is lis
|
111 | 91 | }
|
112 | 92 | ```
|
113 | 93 |
|
114 |
| -## Development |
115 |
| - |
116 |
| -``` bash |
117 |
| -# install dependencies |
118 |
| -npm install |
119 |
| - |
120 |
| -# serve with hot reload at localhost:8080 |
121 |
| -npm run dev |
122 |
| - |
123 |
| -# build for production with minification |
124 |
| -npm run build |
125 |
| -``` |
126 |
| - |
127 |
| -For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader). |
128 |
| - |
129 |
| - |
130 |
| -### Supported Browsers |
131 |
| - |
132 |
| -Latest versions of Chrome/Firefox/Safari/IE/Opera. |
133 |
| - |
134 |
| -### LICENSE |
| 94 | +## Community |
| 95 | +All feedback and suggestions are welcome! |
135 | 96 |
|
136 |
| -MIT |
| 97 | +## License |
| 98 | +This is a open-source software licensed under the [MIT license](https://raw.githubusercontent.com/coderdiaz/vue-status-indicator/master/LICENSE) |
0 commit comments