Skip to content

Commit 190c258

Browse files
author
pc-david\david.desmaisons
committed
Add array.from polyfill (issue #162) + add html for min test + update gulp task
1 parent 0ff8b06 commit 190c258

File tree

7 files changed

+437
-1
lines changed

7 files changed

+437
-1
lines changed

dist/vuedraggable.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
66
(function () {
77
"use strict";
88

9+
if (!Array.from) {
10+
Array.from = function (object) {
11+
return [].slice.call(object);
12+
};
13+
}
14+
915
function buildDraggable(Sortable) {
1016
function removeNode(node) {
1117
node.parentElement.removeChild(node);
@@ -97,6 +103,8 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
97103
};
98104

99105
var draggableComponent = {
106+
name: 'draggable',
107+
100108
props: props,
101109

102110
data: function data() {

dist/vuedraggable.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/Two_Lists_dist.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!doctype html>
2+
<html class="no-js" lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="x-ua-compatible" content="ie=edge">
6+
<title>Example two lists</title>
7+
<meta name="description" content="">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
10+
<link rel="stylesheet" href="css/main.css">
11+
</head>
12+
<body>
13+
14+
<div id="main">
15+
<h1>Vue Dragable</h1>
16+
17+
<div class="drag">
18+
<h2>List 1 draggable</h2>
19+
<draggable class="dragArea" :list="list1" :options="{group:'people'}" @change="log">
20+
<div v-for="(element, index) in list1" >
21+
{{element.name}} {{index}}
22+
</div>
23+
</draggable>
24+
25+
<h2>List 2 draggable</h2>
26+
<draggable class="dragArea" :list="list2" :options="{group:'people'}" @change="log">
27+
<div v-for="(element, index) in list2" :key="index">{{element.name}}</div>
28+
</draggable>
29+
</div>
30+
31+
<div class="normal">
32+
<h2>List 1 v-for</h2>
33+
<div>
34+
<div v-for="element in list1" >{{element.name}}</div>
35+
</div>
36+
37+
<h2>List 2 v-for</h2>
38+
<div>
39+
<div v-for="element in list2" >{{element.name}}</div>
40+
</div>
41+
</div>
42+
43+
<a href="index.html">See basic example</a>
44+
<a href="Two_Lists_Clone.html">See clone element example</a>
45+
<a href="Two_Lists_Clone_If.html">See clone v-if element example</a>
46+
</div>
47+
<script type="text/javascript" src="libs\vue\dist\vue.js"></script>
48+
<script type="text/javascript" src="libs\Sortable\Sortable.js"></script>
49+
<script type="text/javascript" src="dist\vuedraggable.min.js"></script>
50+
<script type="text/javascript" src="script\complex.js"></script>
51+
</body>
52+
</html>

0 commit comments

Comments
 (0)