vue-drag-resize-rotate icon indicating copy to clipboard operation
vue-drag-resize-rotate copied to clipboard

parent=true时边界处理异常问题

Open aMiing opened this issue 2 years ago • 2 comments

<template>
  <div class="view-box">
    <div id="toolbar">基本组件</div>
    <div class="container">
      <vue-drag-resize-rotate :parent="true" :w="width" :h="height" @resizestop="resizestop">
        <div :style="{ width: width + 'px', height: height + 'px', background: '#333' }">
          你可以拖着我,按照自己的意愿调整大小。1
        </div>
      </vue-drag-resize-rotate>
      <vue-drag-resize-rotate>
        <p>你可以拖着我,按照自己的意愿调整大小。2</p>
      </vue-drag-resize-rotate>
    </div>
    <div class="width">
      width:
      <input type="number" name="" id="" :value="width" />
    </div>
    <div class="height">
      height:
      <input type="number" name="" id="" :value="height" />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      width: 300,
      height: 150
    };
  },
  methods: {
    resizestop(x, y, w, h) {
      this.width = w;
      this.height = h;
    }
  }
};
</script>

aMiing avatar Jun 08 '22 14:06 aMiing

上面这个示例能够覆盖当前的问题,当 resizestop 修改属性存在异常,原因可能是 这一行 的width计算出错,深层次原因大概是 this.right 没有被更新。 具体原因还是得大佬帮忙看看~

aMiing avatar Jun 11 '22 16:06 aMiing

拖动除了resizer部分 paren=true 可以正常工作,但是当拖动resizer的时候会出现失效的问题,大佬有时间可以看看

https://user-images.githubusercontent.com/88818049/192920287-a30e4cbd-2da0-4587-8eb1-8615258f1eb3.mp4

lzumi-Sakai avatar Sep 29 '22 01:09 lzumi-Sakai

同遇到问题,动态修改父级宽高时,当parent=true 时 父级的边界处理异常

UserName9565 avatar Dec 01 '22 01:12 UserName9565

我研究了下源码,可以这么解决,在某个时间点 通过refs 调用他的updateParentSize方法 重置下父级的边界

UserName9565 avatar Dec 01 '22 03:12 UserName9565

#23

gausszhou avatar Dec 28 '23 15:12 gausszhou