All Projects → Alvin-Liu → vue-drr

Alvin-Liu / vue-drr

Licence: MIT license
A Vue2 component for draggable, resizable, rotatable elements

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-drr

vue-drag-resize-rotate
一个Vue组件,支持拖拽,拉伸,旋转,放缩,自动对齐;A Vue component that supports dragging, stretching, rotating, scaling, and auto-alignment;
Stars: ✭ 42 (+23.53%)
Mutual labels:  draggable, resizable, rotatable
Moveable
Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
Stars: ✭ 6,378 (+18658.82%)
Mutual labels:  draggable, resizable, rotatable
react-mops
🐶 Modify Orientation Position Size
Stars: ✭ 40 (+17.65%)
Mutual labels:  draggable, resizable, rotatable
TNImageView-Android
Android Library for making scale-able and rotatable image views or giving this power to your own image view. This repo has been depreciated.
Stars: ✭ 18 (-47.06%)
Mutual labels:  draggable, resizable, rotatable
Vue Drag Resize
Vue Component for resize and drag elements
Stars: ✭ 1,007 (+2861.76%)
Mutual labels:  draggable, resizable
Vue Moveable
↔️ ↕️ 🔄 Vue.js wrapper for Moveable
Stars: ✭ 792 (+2229.41%)
Mutual labels:  draggable, resizable
Vue3 Draggable Resizable
[Vue3 组件] 用于拖拽调整位置和大小的的组件,同时支持冲突检测,元素吸附对齐,实时参考线。
Stars: ✭ 159 (+367.65%)
Mutual labels:  draggable, resizable
Magnify
🖼 A jQuery plugin to view images just like in Windows. Browser support IE7+!
Stars: ✭ 177 (+420.59%)
Mutual labels:  draggable, resizable
Svelte Grid
A responsive, draggable and resizable grid layout, for Svelte.
Stars: ✭ 473 (+1291.18%)
Mutual labels:  draggable, resizable
Angular Grid Layout
Responsive grid with draggable and resizable items for Angular applications.
Stars: ✭ 163 (+379.41%)
Mutual labels:  draggable, resizable
React Rnd
🖱 A resizable and draggable component for React.
Stars: ✭ 2,560 (+7429.41%)
Mutual labels:  draggable, resizable
vue2-data-tree
A tree that data is lazy loaded. Support dragging node, checking node, editing node's name and selecting node.
Stars: ✭ 41 (+20.59%)
Mutual labels:  vue2, draggable
Jspanel4
A JavaScript library to create highly configurable floating panels, modals, tooltips, hints/notifiers/alerts or contextmenus for use in backend solutions and other web applications.
Stars: ✭ 217 (+538.24%)
Mutual labels:  draggable, resizable
vue-drag-zone
Drag Zone component for @vuejs
Stars: ✭ 127 (+273.53%)
Mutual labels:  vue2, draggable
Vue Responsive Dash
Responsive, Draggable & Resizable Dashboard (Grid) for Vue
Stars: ✭ 128 (+276.47%)
Mutual labels:  draggable, resizable
Vue Draggable Resizable Gorkys
Vue 用于可调整大小和可拖动元素的组件并支持冲突检测、元素吸附、元素对齐、辅助线
Stars: ✭ 521 (+1432.35%)
Mutual labels:  draggable, resizable
Vue Draggable Resizable
Vue2 Component for draggable and resizable elements.
Stars: ✭ 2,431 (+7050%)
Mutual labels:  draggable, resizable
Draggable Vue Directive
Vue2 directive that handles drag & drop
Stars: ✭ 286 (+741.18%)
Mutual labels:  vue2, draggable
Angular2 Draggable
Angular directive (for version >= 2.x ) that makes the DOM element draggable and resizable
Stars: ✭ 270 (+694.12%)
Mutual labels:  draggable, resizable
Qt Nice Frameless Window
Qt Frameless Window for both Windows and OS X, support Aero Snap, drop shadow on Windows, and support Native Style such as round corner, drop shadow on OS X. Based on QMainWindow.
Stars: ✭ 430 (+1164.71%)
Mutual labels:  draggable, resizable

VueDRR

一个可以拖动、拉伸、旋转的Vue2 组件,基于 vue-draggable-resizable,并优化了部分细节,增加了旋转

中文 | ENGLISH

目录

Demo

Demo


安装和基本用法

$ npm install --save vue-drr

注册组件

import Vue from 'vue'
import VueDrr from 'vue-drr'

Vue.component('vue-drr', VueDrr)

简单例子

<template>
  <div id="app">
    <div style="height: 500px; width: 500px; margin: 20px; border: 1px solid red; position: relative;">
      <vue-drr 
        :x="x" 
        :y="y" 
        :angle="angle" 
        :w="width" 
        :h="height" 
        :parent="true" 
        @dragging="handleDragging"
        @resizing="handleResizing"
        @rotating="handleRotating"
      >
        <p>x: {{ x }}, y: {{ y }}, angle: {{ angle }}, width: {{ width }}, height: {{ height }}</p>
      </vue-drr>
    </div>
  </div>
</template>

<script>
export default {
  name: 'app',
  data: function () {
    return {
      width: 200,
      height: 200,
      x: 50,
      y: 50,
      angle: 30
    }
  },
  methods: {
    handleResizing: function (x, y, width, height) {
      this.x = x
      this.y = y
      this.width = width
      this.height = height
    },
    handleDragging: function (x, y) {
      this.x = x
      this.y = y
    },
    handleRotating: function (angle) {
      this.angle = angle
    }
  }
}
</script>

属性

active

Type: Boolean
Required: false
Default: false

定义组件选中状态,状态更新时,属性值同步变化

draggable

Type: Boolean
Required: false
Default: true

定义组件是否可以拖动

resizable

Type: Boolean
Required: false
Default: true

定义组件是否可以拉伸

rotatable

Type: Boolean
Required: false
Default: true

定义组件是否可以旋转

w

Type: Number
Required: false
Default: 200

定义元素初始宽度

h

Type: Number
Required: false
Default: 200

定义元素初始高度

minw

Type: Number
Required: false
Default: 50

定义元素最小宽度

minh

Type: Number
Required: false
Default: 50

定义元素最小高度

angle

Type: Number
Required: false
Default: 0

定义元素初始角度

x

Type: Number
Required: false
Default: 0

定义元素初始水平位置

y

Type: Number
Required: false
Default: 0

定义元素初始竖直位置

handles

Type: Array
Required: false
Default: ['n', 'e', 's', 'w', 'nw', 'ne', 'se', 'sw']

axis

Type: String
Required: false
Default: both

定义元素在水平、竖直,或者两个方向上拖动

grid

Type: Array
Required: false
Default: [1,1]

定义元素拖动网格

parent

Type: Boolean
Required: false
Default: false

限制元素的移动和维度


方法

activated

Required: false
参数: -

组件上按下鼠标触发

deactivated

Required: false
参数: -

组件外按下鼠标触发

resizing

Required: false
参数:

  • left 水平方向位置
  • top 竖直方向位置
  • width 元素宽度
  • height 元素高度

组件拉伸时触发

resizestop

Required: false
参数:

  • left 水平方向位置
  • top 竖直方向位置
  • width 元素宽度
  • height 元素高度

组件拉伸停止时触发

dragging

Required: false
参数:

  • left 水平方向位置
  • top 竖直方向位置

组件拖动时触发

dragstop

Required: false
参数:

  • left 水平方向位置
  • top 竖直方向位置

组件拖动停止时触发

rotating

Required: false
参数:

  • angle 旋转角度

组件旋转时触发

rotatestop

Required: false
参数:

  • angle 旋转角度

组件旋转停止时触发

License

MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].