From f8e5784bcbef78c22fe27349faf12bc18821c936 Mon Sep 17 00:00:00 2001 From: leehf Date: Wed, 9 Nov 2022 09:44:09 +0800 Subject: [PATCH] containerHeight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the containerHeight after dynamically modifying the margin. Previous code: (this.rowHeight + this.margin[1]) ,Belongs to string addition --- src/components/GridLayout.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/GridLayout.vue b/src/components/GridLayout.vue index 809f67cf..a02e2780 100644 --- a/src/components/GridLayout.vue +++ b/src/components/GridLayout.vue @@ -323,8 +323,9 @@ if (!this.autoSize) return; // console.log("bottom: " + bottom(this.layout)) // console.log("rowHeight + margins: " + (this.rowHeight + this.margin[1]) + this.margin[1]) - const containerHeight = bottom(this.layout) * (this.rowHeight + this.margin[1]) + this.margin[1] + 'px'; - return containerHeight; + // const containerHeight = bottom(this.layout) * (this.rowHeight + this.margin[1]) + this.margin[1] + 'px'; + const containerHeight = bottom(this.layout) * (parseInt(this.rowHeight) + parseInt(this.margin[1])) + parseInt(this.margin[1]); + return containerHeight + 'px'; }, dragEvent: function (eventName, id, x, y, h, w) { //console.log(eventName + " id=" + id + ", x=" + x + ", y=" + y);