Skip to content

Commit 80c0d61

Browse files
Update documentation
1 parent e6af34a commit 80c0d61

File tree

2 files changed

+63
-43
lines changed

2 files changed

+63
-43
lines changed

README.md

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -156,36 +156,9 @@ https://jsfiddle.net/dede89/t3m5krea/
156156
Example with transition-group:
157157
https://jsfiddle.net/dede89/m2v0orcn/
158158
159-
##For Vue.js 1.0
159+
## For Vue.js 1.0
160160
161-
Use it exactly as v-for directive, passing optional parameters using 'options' parameter.
162-
Options parameter can be json string or a full javascript object.
163-
164-
``` html
165-
<div v-dragable-for="element in list1" options='{"group":"people"}'>
166-
<p>{{element.name}}</p>
167-
</div>
168-
```
169-
170-
###Limitation
171-
172-
* This directive works only when applied to arrays and not to objects.
173-
* `onStart`, `onUpdate`, `onAdd`, `onRemove` Sortable.js options hooks are used by v-dragable-for to update VM. As such these four options are not usable with v-dragable-for. If you need to listen to re-order events, you can watch the underlying view model collection. For example:
174-
``` js
175-
watch: {
176-
'list1': function () {
177-
console.log('Collection updated!');
178-
},
179-
```
180-
###fiddle
181-
Simple:
182-
https://jsfiddle.net/dede89/j62g58z7/
183-
184-
Two Lists:
185-
https://jsfiddle.net/dede89/hqxranrd/
186-
187-
Example with list clone:
188-
https://jsfiddle.net/dede89/u5ecgtsj/
161+
[See here](documentation/Vue.dragable.for.ReadMe.md)
189162
190163
## Installation
191164
- Available through:
@@ -196,9 +169,6 @@ https://jsfiddle.net/dede89/u5ecgtsj/
196169
Bower install vue.draggable
197170
```
198171
199-
Version 1.0.9 is Vue.js 1.0 compatible <br>
200-
Version 2.0.2 is Vue.js 2.0 compatible
201-
202172
- #### For Modules
203173
204174
``` js
@@ -213,21 +183,10 @@ Version 2.0.2 is Vue.js 2.0 compatible
213183
}
214184
...
215185

216-
//For Vue.js 1.0 only
217-
import VueDraggable from 'vuedraggable'
218-
import Vue from 'vue'
219-
Vue.use(VueDraggable)
220-
221-
// ES5
222-
//For Vue.js 1.0
223-
var Vue = require('vue')
224-
Vue.use(require('vuedraggable'))
225-
226186
//For Vue.js 2.0
227187
var draggable = require('vuedraggable')
228188
```
229189
230190
- #### For `<script>` Include
231191
232192
Just include `vuedraggable.min.js` or 'vue.dragable.for' after Vue.<br>
233-
lodash(version >=3) is needed only for Vuejs. 1.0 version of the library.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
##For Vue.js 1.0
2+
3+
Use it exactly as v-for directive, passing optional parameters using 'options' parameter.
4+
Options parameter can be json string or a full javascript object.
5+
6+
``` html
7+
<div v-dragable-for="element in list1" options='{"group":"people"}'>
8+
<p>{{element.name}}</p>
9+
</div>
10+
```
11+
12+
###Limitation
13+
14+
* This directive works only when applied to arrays and not to objects.
15+
* `onStart`, `onUpdate`, `onAdd`, `onRemove` Sortable.js options hooks are used by v-dragable-for to update VM. As such these four options are not usable with v-dragable-for. If you need to listen to re-order events, you can watch the underlying view model collection. For example:
16+
``` js
17+
watch: {
18+
'list1': function () {
19+
console.log('Collection updated!');
20+
},
21+
```
22+
###fiddle
23+
Simple:
24+
https://jsfiddle.net/dede89/j62g58z7/
25+
26+
Two Lists:
27+
https://jsfiddle.net/dede89/hqxranrd/
28+
29+
Example with list clone:
30+
https://jsfiddle.net/dede89/u5ecgtsj/
31+
32+
## Installation
33+
- Available through:
34+
``` js
35+
npm install vuedraggable
36+
```
37+
``` js
38+
Bower install vue.draggable
39+
```
40+
41+
Version 1.0.9 is Vue.js 1.0 compatible <br>
42+
43+
- #### For Modules
44+
45+
``` js
46+
// ES6
47+
//For Vue.js 1.0 only
48+
import VueDraggable from 'vuedraggable'
49+
import Vue from 'vue'
50+
Vue.use(VueDraggable)
51+
52+
// ES5
53+
//For Vue.js 1.0
54+
var Vue = require('vue')
55+
Vue.use(require('vuedraggable'))
56+
```
57+
58+
- #### For `<script>` Include
59+
60+
Just include `vuedraggable.min.js` or 'vue.dragable.for' after Vue.<br>
61+
lodash(version >=3) is needed only for Vuejs. 1.0 version of the library.

0 commit comments

Comments
 (0)