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>
相关推荐
wordbaby8 分钟前
React Native + RNOH:跨页面数据回传的最佳实践与避坑指南
前端·react native
GISer_Jing9 分钟前
Three.js着色器编译机制深度解析
javascript·webgl·着色器
丷丩11 分钟前
MapLibre GL JS第22课:查看本地GeoJSON
前端·javascript·map·mapbox·maplibre gl js
油炸自行车21 分钟前
Claude Code 错误:API Error: 400 Failed to deserialize the JSON body into the
开发语言·javascript·json·trae·claude code·api error 400
Front思1 小时前
AI前端工程师需要具备能力+
前端·人工智能·ai
ZC跨境爬虫3 小时前
跟着 MDN 学CSS day_29:(掌握文本与字体样式的核心艺术)
前端·css·ui·html·tensorflow
李子琪。4 小时前
网络空间安全深度实战:CSRF 漏洞原理剖析与基于 Token 的纵深防御体系构建(全栈实验报告)
前端·安全·csrf
冰暮流星4 小时前
javascript之history对象介绍
前端·笔记
IT_陈寒4 小时前
Vite热更新失灵?你可能漏了这个配置
前端·人工智能·后端
丷丩4 小时前
MapLibre GL JS第19课:实时更新要素
前端·javascript·gis·map·mapbox·maplibre gl js