npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mimo-draggable

v0.2.1

Published

A vue directive to let your components drag and drop~

Downloads

6

Readme

vue-draggable

Code in src.

A vue directive to let your components drag and drop ~

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run all tests
npm test

Usage

In template

You can use the v-draggable very easily in your vue application.

<div v-draggable:triggerId="{...options} or 'triggerSelector'">
  <div id="triggerId">This is the trigger</div>
</div>

Directive Arguments

| Arguments | Default | Options | Required | Introduction | |-----------|---------|---------|----------|--------------| | arg | - | - | no | The id of trigger element in binding element. If no this argument, the trigger element will be the binding element. This argument has a higher priority than the next argument. | | value | - | string / object | no | When string, it's the selector of trigger element, If the selector is no matches, the trigger element will be the binding element too; When object, look at options. |

| 指令参数 | 默认值 | 可选项 | 必填 | 简介 | |---------|-------|-------|-----|------| | arg | - | - | 否 | 触发元素的 id。如果不指定,则触发元素是绑定元素本身。优先级比字符串形式的 value 高 | | value | - | 字符串 / 对象 | 否 | 当其是字符串,则指定了触发元素的选择器,如果此选择器没有匹配的元素,则触发元素是绑定元素本身;当其实对象,请看配置项 |

Options

| Name | Default | Options | Required | Introduction | |------|---------|---------|----------|--------------| | draggingStyle | - | - | no | You can change the style attribute of the binding element by this option. | | draggingClass | - | - | no | You can add one class name in the classList of the binding element by this option. | | onDrop | - | - | no | The callback when you release the trigger. It has two arguments. First argument is the current mouse point, the second is the distance between the origin point add the current point. | | onDrag | - | - | no | The callback when you are dragging the element. There is just one argument in this callback that is the current mouse point. | | onCatch | - | - | no | The callback when you are mousedown add ready to drag the element. It has only one argument that is the current mouse point. | | disabled | false | - | no | If true, you can't drag the element any more |

| 名称 | 默认值 | 可选项 | 必填 | 简介 | |-----|-------|--------|-----|-----| | draggingStyle | - | - | 否 | 定义了拖拽时绑定元素额外添加的样式 | | draggingClass | - | - | 否 | 定义了拖拽时绑定元素额外添加的类名 | | onDrop | - | - | 否 | 当一次拖拽完成时的事件回调。接收两个参数,第一个参数是当前鼠标的位置,第二个参数是当前拖动距离原始位置的距离 | | onDrag | - | - | 否 | 拖动时的事件回调。接收一个参数,即当前鼠标的位置 | | onCatch | - | - | 否 | 按下鼠标准备开始拖动时的事件回调。接收一个参数,即当前鼠标的位置 | | disabled | false | - | 否 | 当为 true 时,无法再拖动元素 |