README.md 2.13 KB
Newer Older
Francisco Godoy's avatar
Francisco Godoy committed
1
# vue-like-dislike-buttons
Francisco Godoy's avatar
Francisco Godoy committed
2

Francisco Godoy's avatar
Francisco Godoy committed
3 4
[![Npm version](https://img.shields.io/npm/v/vue-like-dislike-buttons.svg?maxAge=2592000)](https://www.npmjs.com/package/vue-like-dislike-buttons)

Francisco J. Godoy's avatar
Francisco J. Godoy committed
5
## Installation
Francisco Godoy's avatar
Francisco Godoy committed
6

Francisco J. Godoy's avatar
Francisco J. Godoy committed
7 8
```
npm install vue-like-dislike-buttons
Francisco Godoy's avatar
Francisco Godoy committed
9
```
Francisco Godoy's avatar
Francisco Godoy committed
10

Francisco J. Godoy's avatar
Francisco J. Godoy committed
11
or
Francisco Godoy's avatar
Francisco Godoy committed
12 13

```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
yarn add vue-like-dislike-buttons
```

## Usage

```HTML
<vue-like-dislike-buttons :likes="876547" :dislikes="4567" likeChecked />
```

```javascript
import VueLikeDislikeButtons from 'vue-like-dislike-buttons'

export default {
  components: {
    VueLikeDislikeButtons
  }
}
```

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
And styles:

```javascript
import "vue-like-dislike-buttons/src/assets/scss/main.scss"
```

SCSS variables:

```scss
$color-unchecked: #a7a7a7 !default;
$color-hover: darken($color-unchecked, 15%) !default;
$checked-color: darken($color-unchecked, 25%) !default;
@import "~vue-like-dislike-buttons/src/assets/scss/main.scss"
```

Francisco Godoy's avatar
Francisco Godoy committed
48 49
## API

Francisco Godoy's avatar
Francisco Godoy committed
50 51 52 53
### like-dislike-buttons 

#### props 

54
- `dislike-btn-title` ***String*** (*optional*) `default: 'I don't like it'` 
Francisco Godoy's avatar
Francisco Godoy committed
55 56 57

- `dislike-checked` ***Boolean*** (*optional*) `default: false` 

58 59 60
- `dislikes` ***Number*** (*optional*) 

- `is-disabled` ***Boolean*** (*optional*) `default: false` 
Francisco Godoy's avatar
Francisco Godoy committed
61

Francisco J. Godoy's avatar
Francisco J. Godoy committed
62
- `like-btn-title` ***String*** (*optional*) `default: 'I like it'` 
Francisco Godoy's avatar
Francisco Godoy committed
63

64
- `like-checked` ***Boolean*** (*optional*) `default: false` 
Francisco Godoy's avatar
Francisco Godoy committed
65

66
- `likes` ***Number*** (*optional*) 
Francisco J. Godoy's avatar
Francisco J. Godoy committed
67 68 69

- `millions-abbreviation` ***String*** (*optional*) `default: 'M'` 

70 71 72 73
- `only-like` ***Boolean*** (*optional*) `default: false` 

- `thousands-abbreviation` ***String*** (*optional*) `default: 'K'` 

Francisco Godoy's avatar
Francisco Godoy committed
74 75 76 77
#### methods 

- `computeNumber(value)` 

Francisco Godoy's avatar
Francisco Godoy committed
78
## Project setup
Francisco Godoy's avatar
Francisco Godoy committed
79

Francisco Godoy's avatar
Francisco Godoy committed
80 81 82 83 84
```
yarn install
```

### Compiles and hot-reloads for development
Francisco Godoy's avatar
Francisco Godoy committed
85

Francisco Godoy's avatar
Francisco Godoy committed
86
```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
87
yarn serve
Francisco Godoy's avatar
Francisco Godoy committed
88 89 90
```

### Compiles and minifies for production
Francisco Godoy's avatar
Francisco Godoy committed
91

Francisco Godoy's avatar
Francisco Godoy committed
92
```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
93
yarn build
Francisco Godoy's avatar
Francisco Godoy committed
94 95 96
```

### Run your tests
Francisco Godoy's avatar
Francisco Godoy committed
97

Francisco Godoy's avatar
Francisco Godoy committed
98
```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
99
yarn test
Francisco Godoy's avatar
Francisco Godoy committed
100 101 102
```

### Lints and fixes files
Francisco Godoy's avatar
Francisco Godoy committed
103

Francisco Godoy's avatar
Francisco Godoy committed
104
```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
105
yarn lint
Francisco Godoy's avatar
Francisco Godoy committed
106 107 108
```

### Customize configuration
Francisco Godoy's avatar
Francisco Godoy committed
109

Francisco Godoy's avatar
Francisco Godoy committed
110
See [Configuration Reference](https://cli.vuejs.org/config/).
Francisco Godoy's avatar
Francisco Godoy committed
111 112 113 114

### Update the API section of README.md with generated documentation

```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
115
yarn doc:build
Francisco Godoy's avatar
Francisco Godoy committed
116
```
Francisco Godoy's avatar
Francisco Godoy committed
117 118

### Run style guide dev server
Francisco Godoy's avatar
Francisco Godoy committed
119

Francisco Godoy's avatar
Francisco Godoy committed
120
```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
121
yarn styleguide
Francisco Godoy's avatar
Francisco Godoy committed
122 123 124
```

### Generate a static HTML style guide
Francisco Godoy's avatar
Francisco Godoy committed
125

Francisco Godoy's avatar
Francisco Godoy committed
126
```
Francisco J. Godoy's avatar
Francisco J. Godoy committed
127
yarn styleguide:build
Francisco Godoy's avatar
Francisco Godoy committed
128
```
129 130 131 132 133 134

### Update project version

```
yarn version
```