Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

handle to resize an element - done in vue

NotificationsYou must be signed in to change notification settings

vue-comps/vue-resize-handle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

When you want to able to resize an element uni- or bidirectional, you need a resize-handle.

Install

npm install --save-dev vue-resize-handle

or includebuild/bundle.js.

Usage

# link the components upcomponents:"resizer":require"vue-resize-handle/unidirectional"# or:"resizer":require"vue-resize-handle/bidirectional"# when using the bundlecomponents:"resizer":window.vueComps.resizeHandle.uni# or:"resizer":window.vueComps.resizeHandle.bidata:->width:200# or:style:width:200height:200
<div:style="{width:width+'px'}"><resizer:size.sync="width"></resizer></div># or<div:style="style"><resizer:size.sync="style"></resizer></div>

For examples seedev/.

Props

Both
Nametypedefaultdescription
offsetNumber0how far the handle overlaps the parent
extentNumber10extent of the handle in px
Unidirectional
Nametypedefaultdescription
minSizeNumber0minimal size of the parent
defaultSizeNumber-1default size of the parent (will be set if dblclick on handle)
maxSizeNumberNumber.MAX_VALUEmaximal size of the parent
sideString"right"one of "top","right","bottom","left"
sizeNumber-(two-way) will be updated on resize
Bidirectional
Nametypedefaultdescription
minSizeObject{height:0, width:0}minimal size of the parent
defaultSizeObject{height:-1, width:-1}default size of the parent (will be set if dblclick on handle)
maxSizeObject{height:Number.MAX_VALUE, width:Number.MAX_VALUE}maximal size of the parent
keepRatioBooleanfalseenforce aspect ratio
cornerString"se"one of "se","sw","ne","nw" (cardinal points)
sizeObject{height:0, width:0}(two-way) will be updated on resize

Events

NameArgumentsdescription
resize-startthis.size, thisemitted when resize starts
resizethis.size, oldSize, thisemitted on resize and on reset
resize-endthis.size, thisemitted when resize ends
reset-size-emitted on reset afterresize

Development

Clone repository.

npm installnpm run dev

Browse tohttp://localhost:8080/.

License

Copyright (c) 2016 Paul PflugradtLicensed under the MIT license.

About

handle to resize an element - done in vue

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp