1.2.1 • Published 5 years ago

vue-resizable-dissable v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

VueResizable

Latest Version on NPM npm Software License

npm.io

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

PropertyData attributeTypeDefaultDescription
widthwNumber, String200Width
minWidthminWNumber0Minimum width
maxWidthmaxWNumberundefinedMaximum width
heighthNumber, String200Height
minHeightminHNumber0Minimum height
maxHeightmaxHNumberundefinedMaximum height
leftlNumber, String0Offset left from parent
toptNumber, String0Offset top from parent
activeArray'r', 'rb', 'b', 'lb', 'l', 'lt', 't', 'rt'Active handlers for resize
fitParentBooleanfalseRespect parent's size on resizing
dragSelectordragElementsStringundefinedDrag selector
disableHorizontalDragdisableHorizontalDragBooleanfalseDisables horizontal drag
disableVerticalDragdisableVerticalDragBooleanfalseDisables vertical drag
minLeftminLeftNumber-InfinityMinimum left drag
maxLeftmaxLeftNumber-InfinityMaximum left drag

Events

NamePayloadDescription
mounteventName,left,top,width,heightCalled after the component is mounted
destroyeventName,left,top,width,heightCalled before the component is destroyed
resize:starteventName,left,top,width,heightCalled after clicking on one of the active handlers
resize:moveeventName,left,top,width,heightCalled when a handler is being dragged
resize:endeventName,left,top,width,heightCalled when the mouse button was released after resize
drag:starteventName,left,top,width,heightCalled after clicking on one of the drag elements
drag:moveeventName,left,top,width,heightCalled when a drag element is being dragged
drag:endeventName,left,top,width,heightCalled when the mouse button was released after drag

Development

To begin development, run:

npm install 
npm run dev

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

Note

I used the dev file as distribution, because it did not work otherwise, todo: fix later! (package.json main was changed)

License

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

1.2.0

5 years ago

1.2.1

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago