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>
相关推荐
Penge666几秒前
React 事件处理:bind(this) 原理与实际开发常用写法
前端
ZhengEnCi11 分钟前
小白用 AI 做官网完全指南:不用框架的六格清单,双击就能打开
前端·html·ai编程
zhanlang021726 分钟前
HTML 零基础入门到企业实战【第五章 5.2】图片路径精讲:绝对路径、相对路径、网络路径(新手必踩坑点)
前端·html
夕水1 小时前
我用trae重构了ew-color-picker,一个插件化架构的现代颜色选择器
前端·javascript·开源
Penge6661 小时前
React JSX 核心语法:从入门到业务开发实战
前端
zhanlang02171 小时前
HTML 零基础入门到企业实战全套教程【第五章 5.5 综合案例:图文影音展示页面开发】
前端·html
tryCbest1 小时前
Vue3——第 17 篇:模板引用(ref)与组件实例——操作 DOM 的正确姿势
vue.js·前端搭建
zhanlang02171 小时前
HTML 零基础入门到企业实战全套教程【连载 5.3】audio、video 音频视频标签|兼容格式、自动播放踩坑、企业规范
前端·html
qq_406981032 小时前
c++ lamda(三)Lambda表达式
java·前端·c++
头发还在的女程序员2 小时前
Java在线租房系统源码解析:Spring Boot+Vue 3+UniApp房源管理与预约看房方案
java·vue.js·spring boot·租房小程序·租房系统·租房软件