Skip to content

Commit 53febd6

Browse files
docs: ✏️ update readme for v3.0.0
1 parent 43e0105 commit 53febd6

File tree

1 file changed

+35
-14
lines changed

1 file changed

+35
-14
lines changed

README.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can find the source code of examples under `examples` branch.
3030
**Before using the plugin & components, here's something you should know :**
3131

3232
* It's based on [**vue-rx**](https://github.com/vuejs/vue-rx).
33-
* Use vuejs-clipper plugin also add **vue-rx** plugin to vue.
33+
* [**rxjs**](https://github.com/ReactiveX/rxjs/tree/6.x) and [**vue-rx**](https://github.com/vuejs/vue-rx) are required as peer dependencies.
3434
* Components are responsive base on **width** instead of height, see [Component Layout](https://github.com/timtnleeProject/vuejs-clipper/wiki/Component-layout).
3535
* You can clip your own images (local uploaded images or images served on your site), but you cannot clip a cross-origin image unless the image server set the CORS headers.
3636
* Components' **input** is an image URL, **output** is a canvas element, they only help you clip images to canvas, you need to handle other things like *transform file input to image URL* or *transform output canvas to image* by yourself.
@@ -39,16 +39,31 @@ You can find the source code of examples under `examples` branch.
3939

4040
### NPM & ESM
4141

42-
install vuejs-clipper
42+
Install vuejs-clipper
4343

4444
```bash
45-
$npm install vuejs-clipper --save
45+
npm install vuejs-clipper --save
4646
```
4747

48-
need css loader, ex: `sass-loader`, if you haven't installed :
48+
Install peer dependencies if you haven't.
4949

5050
```bash
51-
$npm install -D sass-loader node-sass
51+
npm install vue-rx rxjs --save
52+
```
53+
54+
Need css loader, ex: `sass-loader`, if you haven't installed :
55+
56+
```bash
57+
npm install -D sass-loader node-sass
58+
```
59+
60+
Vuejs-clipper is based on **vue-rx**, so make sure you have vue-rx plugin installed.
61+
62+
```javascript
63+
import Vue from 'vue'
64+
import VueRx from 'vue-rx'
65+
// install vue-rx
66+
Vue.use(VueRx)
5267
```
5368

5469
#### (1) use vuejs-clipper plugin
@@ -59,8 +74,11 @@ By default it will register **all components** to Vue global scope.
5974

6075
```javascript
6176
import Vue from 'vue'
77+
import VueRx from 'vue-rx'
6278
import VuejsClipper from 'vuejs-clipper'
63-
// install
79+
// install vue-rx
80+
Vue.use(VueRx)
81+
// install vuejs-clipper
6482
Vue.use(VuejsClipper)
6583
```
6684

@@ -103,14 +121,6 @@ Vue.use(VuejsClipper, {
103121

104122
#### (2) separately import components
105123

106-
install vue-rx and it's peer dependency rxjs
107-
108-
```bash
109-
$npm install --save vue-rx rx-js
110-
```
111-
112-
use vue-rx
113-
114124
```javascript
115125
import Vue from 'vue'
116126
import VueRx from 'vue-rx'
@@ -136,7 +146,13 @@ export default {
136146
Include vuejs-clipper umd script after Vue.js.
137147

138148
```html
149+
<!-- rxjs-->
150+
<script src="https://unpkg.com/rxjs/bundles/rxjs.umd.js"></script>
151+
<!--vue-->
139152
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>
153+
<!-- vue-rx-->
154+
<script src="https://unpkg.com/vue-rx@6.2.0/dist/vue-rx.js"></script>
155+
<!--vuejs-clipper script & style -->
140156
<script src="./dist/vuejs-clipper.umd.min.js"></script>
141157
<link rel="stylesheet" href="./dist/vuejs-clipper.css">
142158
```
@@ -433,6 +449,11 @@ use `v-model` binding data with `clipper-upload`
433449

434450
## Changelog
435451

452+
* 3.0.0
453+
* Move `rxjs`, `vue-rx` from dependencies to peer dependencies.
454+
455+
---
456+
436457
* 2.1.2
437458
* Fix `clipper-basic` incorrect layout for scaling & rotation (bug of 2.1.1).
438459
* 2.1.1

0 commit comments

Comments
 (0)