Vue3DraggableResizable可移动范围有问题

是这样的,我的Vue3DraggableResizable父级宽度高度尺寸会变化,Vue3DraggableResizable的parent属性设置为true,但是拖拽范围没有随父级宽度高度尺寸而变化,解决方式是给父级容器加key,强制刷新

javascript 复制代码
<div ref="textDivContainer"
               class="all-div-container"
               :style="{'width':bottomCenterWidth + 'px','height':bottomCenterHeight + 'px'}"
               :key="`container-${bottomCenterWidth}-${bottomCenterHeight}`"
          >
            <Vue3DraggableResizable
              v-for="component in allComponents"
              :key="component.id"
              :initW="component.width"
              :initH="component.height"
              v-model:x="component.x"
              v-model:y="component.y"
              v-model:w="component.width"
              v-model:h="component.height"
              v-model:active="component.active"
              :parent="true"
              :draggable="!isComponentLocked(component.id)"
              :resizable="!isComponentLocked(component.id)"
              :handles="['tl','tm','tr','mr','br','bm','bl','ml']"
              class="draggable-resizable-wrapper"
              @resizing="(size) => handleComponentResizing(component.id, size)"
              @dragging="(position) => handleComponentDragging(component.id, position)"
              @activated="() => handleComponentActivated(component.id)"
              @deactivated="() => handleComponentDeactivated(component.id)"
            >
              <component
                :is="getComponent(component)"
                v-if="getComponent(component)"
                v-bind="getComponentProps(component)"
                :ref="(el) => {
                  if (component.type === 'model3d' && el) {
                    threeDimModuleRefs.set(component.id, el)
                  } else if (component.type === 'model3d' && !el) {
                    threeDimModuleRefs.delete(component.id)
                  }
                }"
                @update="handleComponentTextUpdate(component.id, $event)"
              />
            </Vue3DraggableResizable>
          </div>
相关推荐
小poop3 小时前
CSS 基础与实战:从入门到精通网页美化
前端
Csvn5 小时前
运行时性能
前端
Never_every995 小时前
位图转矢量工具哪个好?实测抠抠图AI位图转矢量工具
大数据·前端
paopaokaka_luck6 小时前
宠物门店经营管理系统(销售与库存联动、进货自动记账、 退换与退款关联、员工个人业绩、ECharts 经营分析、滞销识别与客户分层、宠物档案年龄计算)
前端·javascript·spring boot·mysql·echarts·mybatis·1024程序员节
空中湖6 小时前
用 React 写数据大屏:为什么我不建议用图表库
前端·react.js·前端框架
欣欣之王来了8 小时前
原始HTML插值:v-html指令的使用与安全风险
前端·学习·架构·项目·vue3教程
IT_陈寒8 小时前
Redis的LRU淘汰策略坑了我一整天
前端·人工智能·后端
计算机魔术师8 小时前
砍半价格、参数再涨,国产旗舰追到 Opus 鼻尖了
前端
paopaokaka_luck8 小时前
心理咨询管理系统(WebSocket实时沟通、基于用户的协同过滤、 ECharts多维分析、 预约业务流程、预约校验与定时处理)
java·vue.js·spring boot·mysql·spring·echarts·1024程序员节
特立独行的猫A8 小时前
10 MB 的桌面 AI 客户端:用仓颉 + 系统 WebView 替代 Electron
前端·harmonyos