Skip to content

Commit 42994c3

Browse files
docs: ✏️ Update import dist files
1 parent 03ad7a1 commit 42994c3

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

README.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ You can find the source code of examples under `examples` branch.
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.
3737

38-
## Installation
39-
40-
### NPM & ESM
38+
## Installation (NPM & ESM)
4139

4240
Install vuejs-clipper
4341

@@ -51,12 +49,6 @@ Install peer dependencies if you haven't.
5149
npm install vue-rx rxjs --save
5250
```
5351

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-
6052
Vuejs-clipper is based on **vue-rx**, so make sure you have vue-rx plugin installed.
6153

6254
```javascript
@@ -65,12 +57,32 @@ import VueRx from 'vue-rx'
6557
// install vue-rx
6658
Vue.use(VueRx)
6759
```
60+
Make sure to install **vue-rx** plugin first.
6861

69-
#### (1) use vuejs-clipper plugin
62+
### Import
7063

71-
Make sure to install **vue-rx** plugin first.
64+
#### use dist files
7265

73-
By default vuejs-clipper plugin will register **all components** to Vue global scope.
66+
```javascript
67+
import Vue from "vue";
68+
import VueRx from "vue-rx";
69+
// Use build files
70+
import VuejsClipper from "vuejs-clipper/dist/vuejs-clipper.umd";
71+
import "vuejs-clipper/dist/vuejs-clipper.css";
72+
73+
Vue.use(VueRx);
74+
Vue.use(VuejsClipper);
75+
```
76+
77+
#### use vuejs-clipper soruce
78+
79+
You are using `vuejs-clipper` directly with your build proccess(webpack etc).
80+
81+
So make sure you have css loader, ex: `sass-loader`, if you haven't installed :
82+
83+
```bash
84+
npm install -D sass-loader node-sass
85+
```
7486

7587
```javascript
7688
import Vue from 'vue'
@@ -82,6 +94,10 @@ Vue.use(VueRx)
8294
Vue.use(VuejsClipper)
8395
```
8496

97+
### Config
98+
99+
By default vuejs-clipper plugin will register **all components** to Vue global scope.
100+
85101
register some components to global with default component name
86102

87103
```javascript
@@ -119,7 +135,7 @@ Vue.use(VuejsClipper, {
119135
})
120136
```
121137

122-
#### (2) separately import components
138+
#### separately import components
123139

124140
```javascript
125141
import Vue from 'vue'
@@ -141,7 +157,7 @@ export default {
141157
}
142158
```
143159

144-
### Script
160+
## Installation (Script)
145161

146162
Include vuejs-clipper umd script after Vue.js.
147163

0 commit comments

Comments
 (0)