All Projects → bcakmakoglu → revue-draggable

bcakmakoglu / revue-draggable

Licence: MIT license
A Vue component that makes anything draggable 🤏 Easy to use and control. Supports Vue3 and Vue2 🦾

Programming Languages

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

Projects that are alternatives of or similar to revue-draggable

vue3-smooth-dnd
Vue3 wrapper components for smooth-dnd
Stars: ✭ 92 (-21.37%)
Mutual labels:  draggable, vue3
v-drag
The simplest way to integrate dragging on Vue.js
Stars: ✭ 71 (-39.32%)
Mutual labels:  draggable, vue3
vite-vue3-lowcode
vue3.x + vite2.x + vant + element-plus H5移动端低代码平台 lowcode 可视化拖拽 可视化编辑器 visual editor 类似易企秀的H5制作、建站工具、可视化搭建工具
Stars: ✭ 1,309 (+1018.8%)
Mutual labels:  draggable, vue3
insta-share
Instant File Sharing powered by IPFS Networks. Build with Vue 3 and ViteJS
Stars: ✭ 53 (-54.7%)
Mutual labels:  vue3
jetstream-inertia-generator
Laravel 8 Admin CRUD generator built with Jetstream, Inertia js, Vue 3 and Tailwindcss 2
Stars: ✭ 105 (-10.26%)
Mutual labels:  vue3
vue-component-lib-starter
A bare-bones example of creating your own Vue component library.
Stars: ✭ 221 (+88.89%)
Mutual labels:  vue3
vue-virtualised
Blazing fast scrolling and updating for any amount of list and hierarchical data.
Stars: ✭ 18 (-84.62%)
Mutual labels:  vue3
inertiajs-tables-laravel-query-builder
Inertia.js Tables for Laravel Query Builder
Stars: ✭ 391 (+234.19%)
Mutual labels:  vue3
Admin-Frame-Vue3
基于Vue3 + Element-Plus + Vite 开发的中/后台管理系统
Stars: ✭ 181 (+54.7%)
Mutual labels:  vue3
fastadmin
vue3 + element-plus fast admin scaffold, 基于vue3和ElementPlus的中后台快速应用脚手架
Stars: ✭ 50 (-57.26%)
Mutual labels:  vue3
kendo-vue
Issue tracker - Kendo UI for Vue http://www.telerik.com/kendo-vue-ui/
Stars: ✭ 49 (-58.12%)
Mutual labels:  vue3
chengpeiquan.com
My personal website. Base on Vite 2.0 and Vue 3.0. If you want to know how to use Vite to develop a project, you can refer to this repository.
Stars: ✭ 43 (-63.25%)
Mutual labels:  vue3
ECHI VUE TODO
使用 Vue 开发的一款 TODO 应用,包含登录、待办、日程、历史事项、回收站。项目较为小型,适合进阶学习使用(💡请注意,项目大量使用 jsx 进行开发)。
Stars: ✭ 19 (-83.76%)
Mutual labels:  vue3
react-mops
🐶 Modify Orientation Position Size
Stars: ✭ 40 (-65.81%)
Mutual labels:  draggable
miter-design
Miter Design component library made with ♡ by Prefect
Stars: ✭ 14 (-88.03%)
Mutual labels:  vue3
react-native-dnd-board
A drag and drop Kanban board for React Native.
Stars: ✭ 41 (-64.96%)
Mutual labels:  draggable
win7
Yet another OS preview via web technologies focused on Microsoft Windows 7.
Stars: ✭ 93 (-20.51%)
Mutual labels:  vue3
vue3-element-plus-im
vue3-element-plus-im vue3.0 element-plus vue-cli vue-router vuex composition-api axois websocket 即时聊天 前端vue 后端java springboot netty 即时通讯 chat
Stars: ✭ 93 (-20.51%)
Mutual labels:  vue3
radishes
Cross-platform copyright-free music platform(跨平台的无版权音乐平台). 支持 windows / macos / linux / web
Stars: ✭ 212 (+81.2%)
Mutual labels:  vue3
vue3-chartjs
Vue3 wrapper for ChartJS
Stars: ✭ 122 (+4.27%)
Mutual labels:  vue3

Revue Draggable

top-language dependencies Status devDependencies Status vulnerabilities GitHub code size in bytes GitHub last commit

Make your Vue components draggable. 🤏

Supports Vue 2 and Vue 3! Comes with a 🔋 batteries included component / directive / composable or for users who want more control a simple abstraction over drag events with the core, wich is also available as a component / directive / composable.

Based on React Draggable.

Check the Docs 📔 for an in-depth explanation and the Demo 🪄 to see Revue Draggable in action.

Table of Contents

🛠 Setup

# install revue draggable
$ yarn add @braks/revue-draggable

# or
$ npm i --save @braks/revue-draggable

For Vue2 add the composition-api to your dependencies.

# install revue flow
$ yarn add @braks/revue-draggable @vue/composition-api

# or
$ npm i --save @braks/revue-draggable @vue/composition-api

Using the components

Webpack (Vue2)

// webpack.config.js

resolve: {
    alias: {
        vue: 'vue/dist/vue.js'
    }
}

Nuxt

// nuxt.config.ts
export default {
    alias: {
        vue: 'vue/dist/vue.js'
    }
}

🔌 Registering Revue Draggable

// Vue3
import { createApp } from 'vue';
import Draggable, { DraggablePlugin, DraggableDirective } from '@braks/revue-draggable';

const app = createApp();

// Use as Plugin (registers directives and components)
app.use(DraggablePlugin);

// or
app.directive('draggable', DraggableDirective)
app.component('Draggable', Draggable);

app.mount('#root');
// Vue2 
import Vue from 'vue';
import { DraggablePlugin, DraggableDirective } from '@braks/revue-draggable';

// Use as Plugin
Vue.use(DraggablePlugin)

// or
Vue.directive('draggable', DraggableDirective)
Vue.component('Draggable', Draggable)

🎮 Quickstart

The easiest way to make your elements draggable is by using the DraggableDirective which will handle everything for you with no configuration necessary.

<template>
  <div v-draggable="/* Pass DraggableProps as binding value here */" class="box">I use a directive to make myself draggable</div>
</template>
<script>
... the rest of your code

Or use the component wrapper. (In Vue2 make sure to include the full-build, runtime-build only works for Vue3.)

<template>
  <Draggable>
    <div class="box">I use a wrapper</div>
  </Draggable>
</template>
<script>
... the rest of your code

Check the example file for more in-detail examples like dropping elements, setting boundaries or syncing states.

🧪 Development

This project uses Vite for development and Rollup to create a distribution.

# start (dev)
$ yarn dev

# build app
$ yarn build

# serve app from build
$ yarn serve

# build dist
$ yarn build:dist

🐛 Debugging

Set the environment variable DRAGGABLE_DEBUG to enable logs on drag handlers.

🕵🏻‍♂️ Tests

Testing is done with Cypress. You can find the specs in the cypress directory;

$ yarn ci # starts test server and runs tests, make sure port 3000 is open

💝 Sponsors

Special thanks go to sponsors! jfrueh

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].