Skip to content

Commit e6badfd

Browse files
authored
Make margin reactive.
1 parent 6d756de commit e6badfd

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
@@ -377,7 +377,15 @@
377377
},
378378
maxW: function () {
379379
this.tryMakeResizable();
380-
}
380+
},
381+
"$parent.margin": function (margin) {
382+
if (!margin || (margin[0] == this.margin[0] && margin[1] == this.margin[1])) {
383+
return;
384+
}
385+
this.margin = margin.map(m => parseInt(m));
386+
this.createStyle();
387+
this.emitContainerResized();
388+
},
381389
},
382390
computed: {
383391
classObj() {

0 commit comments

Comments
 (0)