Skip to content

Commit b78c2a5

Browse files
adding deep listening, issue #142
1 parent e68e55e commit b78c2a5

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

dist/vuedraggable.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,18 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
155155
},
156156

157157
watch: {
158-
options: function options(newOptionValue) {
159-
for (var property in newOptionValue) {
160-
if (readonlyProperties.indexOf(property) == -1) {
161-
this._sortable.option(property, newOptionValue[property]);
158+
options: {
159+
handler: function handler(newOptionValue) {
160+
for (var property in newOptionValue) {
161+
if (readonlyProperties.indexOf(property) == -1) {
162+
this._sortable.option(property, newOptionValue[property]);
163+
}
162164
}
163-
}
165+
},
166+
167+
deep: true
164168
},
169+
165170
realList: function realList() {
166171
this.computeIndexes();
167172
}
@@ -257,7 +262,6 @@ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
257262
var nodes = this.getChildrenNodes();
258263
nodes[index].data = null;
259264
var transitionContainer = this.getComponent();
260-
var oldChildren = transitionContainer.children;
261265
transitionContainer.children = [];
262266
transitionContainer.kept = undefined;
263267
},

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.

src/vuedraggable.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,15 @@
133133
},
134134

135135
watch: {
136-
options(newOptionValue) {
137-
for (var property in newOptionValue) {
138-
if (readonlyProperties.indexOf(property) == -1) {
139-
this._sortable.option(property, newOptionValue[property]);
136+
options:{
137+
handler(newOptionValue) {
138+
for (var property in newOptionValue) {
139+
if (readonlyProperties.indexOf(property) == -1) {
140+
this._sortable.option(property, newOptionValue[property]);
141+
}
140142
}
141-
}
143+
},
144+
deep: true
142145
},
143146

144147
realList() {

0 commit comments

Comments
 (0)