Giter VIP home page Giter VIP logo

vue-resizable2's Introduction

VueResizable

Latest Version on NPM npm Software License

Vue component that allows you to resize and drag elements

Demo

Demo page
CodeSandbox
Material window

Installation

npm install vue-resizable --save

Basic usage

<template>
    <vue-resizable>
        <div class="resizable-content"></div>
    </vue-resizable>
</template>

<script>
import VueResizable from 'vue-resizable'

export default {
    name: "YourApp",
    components: {VueResizable}
}
</script>

<style scoped>
    .resizable-content {
        height: 100%;
        width: 100%;
        background-color: aqua;
    }
</style>

Properties

Property Data attribute Type Default Description
width w [Number, String] undefined Width in pixel or 'auto'
minWidth minW Number 0 Minimum width
maxWidth maxW Number undefined Maximum width
height h [Number, String] undefined Height in pixel, or 'auto'
minHeight minH Number 0 Minimum height
maxHeight maxH Number undefined Maximum height
left l [Number, String] 0 Offset left from parent
top t [Number, String] 0 Offset top from parent
active Array ['r', 'rb', 'b', 'lb', 'l', 'lt', 't', 'rt'] Active handlers for resize
fitParent Boolean false Respect parent's size on resizing
dragSelector dragElements String undefined Drag selector
maximize Boolean false Maximize element to parent size
disableAttributes calcMap Array [] Disable changes to attributes, Available values: ['l', 't', 'w', 'h']

Events

Name Payload Description
mount [eventName,left,top,width,height] Called after the component is mounted
destroy [eventName,left,top,width,height] Called before the component is destroyed
resize:start [eventName,left,top,width,height] Called after clicking on one of the active handlers
resize:move [eventName,left,top,width,height] Called when a handler is being dragged
resize:end [eventName,left,top,width,height] Called when the mouse button was released after resize
drag:start [eventName,left,top,width,height] Called after clicking on one of the drag elements
drag:move [eventName,left,top,width,height] Called when a drag element is being dragged
drag:end [eventName,left,top,width,height] Called when the mouse button was released after drag
maximize [eventName,left,top,width,height, state] Called when "maximize" state changed

Development

To begin development, run:

npm install 
npm run dev

It starts webpack-dev-server on localhost:8080 with Demo page.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

vue-resizable2's People

Contributors

nikitasnv avatar picoi2 avatar biggestcookie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.