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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-auto-drag

v1.0.4

Published

div自由拖拽

Readme

GitHub stars Build Status GitHub issues GitHub forks GitHub last commit license

NPM NPM

vue-auto-drag

自由拖拽div的vue组件, 上下左右或自由拖拽div,改变div的高度和宽度 auto drag components, drag you components to change height or width

Example

Demo Page 示例地址

Changelog

git commit

use

NPM

npm install vue-auto-drag --save

YARN

yarn add vue-auto-drag

props

参数 | 说明 | 类型 | 默认值 --------- | ---------------------------------------------------- | -------------- | ---- dragMove | 自由拖拽 | boolean | false dragLeft | 左侧拖拽 | boolean | false dragTop | 顶部拖拽 | boolean | false dragRight | 右侧拖拽 | boolean | false dragBottom | 底部拖拽 | boolean | false maxWidth | 拖拽最大宽度 | number | - minWidth | 拖拽最大宽度 | number | - maxHeight | 拖拽最大高度 | number | - minHeight | 拖拽最小高度 | number | -

Mount

mount with global

// require lib
import Vue from 'vue'
import VueAutoDrag from 'vue-auto-drag'


// you can set default global options and events when use
Vue.use(VueAutoDrag)

mount with component

// require component
import VueAutoDrag from 'vue-auto-drag'

// component
export default {
    components: {
        VueAutoDrag
    }
}

Component

<template>
    <div class="ui-auto-drag-wrap">
        <div class="container">
            <auto-drag  
                :maxWidth="300"
                :minWidth="100"
                class="left-wrap" 
                dragRight>
                <div class="left">左</div>
            </auto-drag>
            
            <div class="main">
                <auto-drag 
                    :maxHeight="300"
                    :minHeight="100"
                    class="top-wrap" 
                    dragBottom>
                    <div class="top">上</div>
                </auto-drag>
                <div class="center"></div>
                <auto-drag class="bottom-wrap" dragTop>
                    <div class="bottom">下</div>
                </auto-drag>
            </div>
            <auto-drag  class="right-wrap" dragLeft>
                <div class="right">右</div>
            </auto-drag>
        </div>
        <auto-drag class="move-wrap" dragMove>
            <div class="move">移动</div>
        </auto-drag>
    </div>
</template>

<script>
import AutoDrag from '../src/index.js';
export default {
    components: {
        AutoDrag,
    }
};
</script>

<style lang="scss">
.ui-auto-drag-wrap {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    .container {
        position: absolute;
        width: 100%;
        height: 100%;
        overflow: hidden;
        display: flex;
    }
    .left-wrap {
        height: 100%;
        width: 200px;
        border-right: 1px solid #e6e6e6;
        flex-shrink: 0;
    }
    .main {
        width: 100%;
        height: 100%;
        overflow: hidden;
        flex-shrink: 1;
        display: flex;
        flex-direction: column;
        .top-wrap {
            width: 100%;
            height: 200px;
            border-bottom: 1px solid #e6e6e6;
            flex-shrink: 0;
        }
        .center {
            width: 100%;
            height: 100%;
            flex-shrink: 1;
        }
        .bottom-wrap {
            width: 100%;
            height: 200px;
            border-top: 1px solid #e6e6e6;
            flex-shrink: 0;
        }
    }
    .right-wrap {
        height: 100%;
        width: 200px;
        border-left: 1px solid #e6e6e6;
        flex-shrink: 0;
    }
    .move-wrap {
        position: absolute;
        left: 100px;
        top: 100px;
        z-index: 3;
        width: 200px;
        height: 200px;
        border: 1px solid #e6e6e6;
        background-color: #f2f2f2;
        box-shadow: 0 2px 9px 0 rgba(0, 0, 0, 0.25);
    }
}
</style>

Author

zwfun

#License

MIT License