Giter VIP home page Giter VIP logo

vue3-drag-resize-rotate's People

Contributors

fengjing95 avatar gakkiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii avatar gausszhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue3-drag-resize-rotate's Issues

在初次渲染组件时,增加位置与边界的判断

当使用这个库为移动端写框架布局时,假设一开始是为ipad做的位置和长宽,然后后来又有一个连接来自手机,那么此时加载框架时,内部的元素就可能超过页面边界。因为一开始渲染的时候并没有做边界碰撞的判断。这个可以优化下
image

在拖动调整大小时宽高会出现小数

在拖动和调整区域的大小时宽高会出现超长小数位

  • 拖动边界调整宽高会出现下图这种情况

感觉缓慢拖动的时候触发概率可能会高一些

复现

使用官网示例中的 事件(新增)-> 调整大小事件

Configure handle size via CSS

Currently, the handle size is configured via style attributes and manual pixel value calculations:

tm: {
top: `${offset}px`,
left: `calc(50% - ${center}px)`,
},

That makes it very inconvenient to override it with CSS. For instance, I wanted the handle to increase slightly on hover, but that's not directly possible as you're not only hardcoding fixed width in a style but also use it to calculate fixed pixel offsets (see above).

I propose to get rid of handleInfo completely, and use CSS for handle size, and replace hardcoded values inside calc with translate for centering:

.handle {
  width: 8px;
  height: 8px;
  &-tl {
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
  }
  &-tr {
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
  }
  &-bl {
    bottom: 0;
    left: 0;
    transform: translate(-50%, 50%);
  }
  &-br {
    bottom: 0;
    right: 0;
    transform: translate(50%, 50%);
  }
  &-rot {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

This is what I actually ended up doing, passing :handle-info="{ size: 0, offset: 0, switch: true }" to get rid of the hardcoded offsets. My point is that's how the library should work in the first place.

[BUG] 单击一次激活事件触发两次

你好,我更新到3.0.2后,测试激活事件,目前在仅局部可拖动的情况下,点击整体均可激活,但是会发生激活两次的情况,下面是我具体的代码
image
image
单击一个
image
切换目标
image
我是在用这个组件实现一个可拖拽的WEB窗口,需要在激活的时候切换目标到最上层,我在该组件外层加了一个dialog,需要根据zIndex控制dialog的zIndex,做到不同窗口的前后切换,你看我该如何解决,另外我想知道这个组件有关于移动时动画优化的控制没,我发现在打开多个窗口时,移动时会不跟鼠标,有一定的延迟,这有办法解决吗

dragging事件

我在dragging事件中判断是否超出范围,限制拖动,但是赋值了之后还是没能限制,我设置的x,y不生效,元素照样跟着鼠标拖动

使用了旋转后,父级限制不正常

拖拽

怎么让元素只能在边框进行拖拽,并修改鼠标样式

z-Index setting it does not work

I am trying to set the z parameter to bring the element up front and it is not working. I check the html and it is set to auto

[bug]无法激活组件

当设置仅窗口标题栏可以拖动时,就无法点击窗体激活组件,只能点击标题栏激活,如何设置?
个人感觉组件激活与否与拖拽应当分开,我是在做多窗口功能时发现的,需要点击B窗体的时候,A窗体自动触发失活事件,但仅能通过标题栏拖动窗体,拜托,看到赶紧回复

组件嵌套的时候,我想只激活最内层的组件,最外层的组件不激活,移动最内层组件的时候,最外层组件不动,目前好像实现不了

高度更新貌似有些问题

环境:vue3
场景:多图片替换
复线:默认有个120120的图片,w,h 类用
切换图片的时候230
400的图片 w适配了 但是h还是原有的h

Don't use scoped styles for overrideable styles

Currently, the library publishes styles in @gausszhou/vue3-drag-resize-rotate/lib/bundle.esm.css as .vue-drag-resize-rotate[data-v-3c286975] { ... }

This makes it inconvenient to override (amend) the styles in the project. One either have to copy the scope selector (which is error prone, as the scope ID is auto generated and will change on every package update), or trick CSS to narrow the selector with some sort of hack, for instance :root .vue-drag-resize-rotate { ... }

In my thinking, library solutions should not be using scoped (or module) styles. The library styles are supposed to have a well recognizable place in the global scope, so that user could easily override them without additional hacks.

Types and docs-translation

Hello Sir,

first of all, I want to say that this is a very good project and like the Vue component. I would like, to make the library more accessible to the general public, by translating the documentation into English. One possibility is to add a button that switches between the languages.

Also, I noticed that there are currently no types for Typescript.

I would like to contribute by providing translations for English and adding the types. I just need an okay from the maintainer, so that the changes will be applied after consultation and review.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.