From 9cd97e37a5f969b1723178ae03f870b037f73d78 Mon Sep 17 00:00:00 2001 From: LCJ-MinYa <1049468118@qq.com> Date: Fri, 30 Jan 2026 16:33:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8B=96=E6=8B=BD=E5=B8=83=E5=B1=80-?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=EF=BC=8C=E5=AE=BD=E5=BA=A6=E5=8F=91=E7=94=9F?= =?UTF-8?q?=E5=8F=98=E5=8C=96=E6=97=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demoHtml/flex/js/index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/demoHtml/flex/js/index.js b/demoHtml/flex/js/index.js index 97e4c04..6c0a7cc 100644 --- a/demoHtml/flex/js/index.js +++ b/demoHtml/flex/js/index.js @@ -147,6 +147,13 @@ handleRemoveComponent(item); }); }); + + self['grid'].on('change', function (_event, itemArray) { + console.log(itemArray, '这里触发了布局的change事件'); + itemArray.forEach((item) => { + handleChangeComponent(item, self); + }); + }); }; // 处理添加组件之后的操作 @@ -247,6 +254,15 @@ }); }; + var handleChangeComponent = (component) => { + if (currentComponent && currentComponent.id === component.id) { + let width = component.w * (1920 / 24); + $('#width').val(width); + let height = component.h * cellHeight * 2; + $('#height').val(height); + } + }; + var handleRemoveComponent = (component) => { if (currentComponent && currentComponent.id === component.id) { currentComponent = null;