0.2.7 • Published 4 years ago

vue-displace v0.2.7

Weekly downloads
52
License
MIT
Repository
github
Last release
4 years ago

vue-displace

Vue Directive to allow dragging elements or components. Uses displacejs under the hood

⚙️ Installation

$ npm install vue-displace

📄 Documents

Example

displacejs

🚀 How to use in Vue

In main.js

import displace from "vue-displace";

Vue.use(displace)
<template>
  <div id="app">
        <div :id="55" v-displace @onMouseDown="log" @onMouseMove="log" @onMouseUp="log" class="item">
      im a div please drag me
    </div>
  </div>
</template>

<script>
export default {
  name: "app",
  methods: {
    log(e) {
      console.log(e);
    }
  }
};
</script>

<style>
.item {
  width: 200px;
  height: 200px;
  background: red;
}
</style>

Events emitted: onMouseDown onMouseMove onMouseUp onTouchStart onTouchMove onToughStop

customMove and ignoreFn are passed as follows:

v-displace="{customMove:someMethodHere, ignoreFn:someOtherMethodHere}"

⭐️ Show Your Support

Please give a ⭐️ if this project helped you!

👏 Contributing

If you have any questions or requests or want to contribute to vue-displace or other packages, please write the issue or give me a Pull Request freely.

🐞 Bug Report

If you find a bug, please report to us opening a new Issue on GitHub.

⚙️ Development

npm run serve

Runs the app in the development mode. Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago