From 4c636a77bce2195029ca30a853428ba5f8077106 Mon Sep 17 00:00:00 2001 From: "pc-david\\david.desmaisons" Date: Tue, 1 Nov 2016 11:18:33 -0200 Subject: [PATCH] Correcting bug when list is empty --- dist/vuedraggable.js | 2 +- dist/vuedraggable.min.js | 2 +- package.json | 2 +- src/vuedraggable.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/vuedraggable.js b/dist/vuedraggable.js index c3fa058e..2db61647 100644 --- a/dist/vuedraggable.js +++ b/dist/vuedraggable.js @@ -88,7 +88,7 @@ }; }, render: function render(h) { - if (this.$slots.default.length === 1) { + if (this.$slots.default && this.$slots.default.length === 1) { var child = this.$slots.default[0]; if (child.componentOptions && child.componentOptions.tag === "transition-group") { this.transitionMode = true; diff --git a/dist/vuedraggable.min.js b/dist/vuedraggable.min.js index 88404950..a734b80d 100644 --- a/dist/vuedraggable.min.js +++ b/dist/vuedraggable.min.js @@ -1 +1 @@ -"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function t(t){function e(t){t.parentElement.removeChild(t)}function n(t,e,n){nr-1?r:i[o];this.list.splice(s,0,n),this.computeIndexes()}},onDragRemove:function(t){if(this.list){n(this.rootContainer,t.item,t.oldIndex);var i=!!t.clone;if(i)return void e(t.clone);var o=this.context.currentIndex;this.list.splice(o,1)}},onDragUpdate:function(t){if(this.list){e(t.item),n(t.from,t.item,t.oldIndex);var i=this.context.currentIndex,r=this.visibleIndexes[t.newIndex];o(this.list,i,r)}},onDragEnd:function(t){this.computeIndexes()}}};return c}if(typeof exports == "object"){var e=require("sortablejs");module.exports=t(e)}else if("function"==typeof define&&define.amd)define(["Sortable"],function(e){return t(e)});else if(window&&window.Vue&&window.Sortable){var n=t(window.Sortable);Vue.component("draggable",n)}}(); \ No newline at end of file +"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function t(t){function e(t){t.parentElement.removeChild(t)}function n(t,e,n){nr-1?r:i[o];this.list.splice(s,0,n),this.computeIndexes()}},onDragRemove:function(t){if(this.list){n(this.rootContainer,t.item,t.oldIndex);var i=!!t.clone;if(i)return void e(t.clone);var o=this.context.currentIndex;this.list.splice(o,1)}},onDragUpdate:function(t){if(this.list){e(t.item),n(t.from,t.item,t.oldIndex);var i=this.context.currentIndex,r=this.visibleIndexes[t.newIndex];o(this.list,i,r)}},onDragEnd:function(t){this.computeIndexes()}}};return c}if(typeof exports == "object"){var e=require("sortablejs");module.exports=t(e)}else if("function"==typeof define&&define.amd)define(["Sortable"],function(e){return t(e)});else if(window&&window.Vue&&window.Sortable){var n=t(window.Sortable);Vue.component("draggable",n)}}(); \ No newline at end of file diff --git a/package.json b/package.json index d4c953c2..b95af779 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuedraggable", - "version": "2.2.0", + "version": "2.3.1", "description": "draggable component for vue", "main": "dist/vuedraggable.js", "files": [ diff --git a/src/vuedraggable.js b/src/vuedraggable.js index 771a7208..8848283b 100644 --- a/src/vuedraggable.js +++ b/src/vuedraggable.js @@ -79,7 +79,7 @@ }, render (h) { - if (this.$slots.default.length===1) { + if (this.$slots.default && this.$slots.default.length===1) { const child = this.$slots.default[0] if (child.componentOptions && child.componentOptions.tag==="transition-group") { this.transitionMode = true