Skip to content

Commit d040da4

Browse files
authored
Merge pull request jbaysolutions#380 from yfwz100/yfwz100-reactive-margin
Make margin reactive.
2 parents 7140c0f + d54b8d8 commit d040da4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/GridItem.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,15 @@
379379
},
380380
maxW: function () {
381381
this.tryMakeResizable();
382-
}
382+
},
383+
"$parent.margin": function (margin) {
384+
if (!margin || (margin[0] == this.margin[0] && margin[1] == this.margin[1])) {
385+
return;
386+
}
387+
this.margin = margin.map(m => Number(m));
388+
this.createStyle();
389+
this.emitContainerResized();
390+
},
383391
},
384392
computed: {
385393
classObj() {

0 commit comments

Comments
 (0)