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

side-nav - done in vue

NotificationsYou must be signed in to change notification settings

vue-comps/vue-side-nav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-side-nav

for the best user-experience when navigating your side, you can use a responsive side-nav.

Install

npm install --save-dev vue-side-nav// vue touch@next - not released on npm currentlynpm install --save-dev git://github.com/vuejs/vue-touch.git#next// vue@1.0npm install --save-dev vue-side-nav@1 vue-touch@1

or includebuild/bundle.js.

Usage

# somewhereVue.use(require('vue-touch'))# in your componentcomponents:"side-nav":require("vue-side-nav")# or, when using bundle.jscomponents:"side-nav":window.vueComps.sideNav
<side-nav><li>First Text<li></side-nav><!-- sibling elements will be set to margin-left:240px for `fixed` and `is-fixed=true` --><container></container>

For examples seedev/.

ERROR: Module build failed: SyntaxError: 'with' in strict mode

Currentlybuble is injectingstrict mode in all processed js files. The down to ES5 compiled component containswith, which is forbidden instrict mode.Buble is used, for example, in rollup, which is used in laravel.

If you are running in this problem, make sure to exclude this component from processing with buble.

Props

Nametypedefaultdescription
widthNumber240width of the side-nav
fixed-screen-sizeNumber992Used withfixed. Above this size, the menu will stay opened.
not-dismissableBooleanfalseA click on the overlay will not dismiss it
close-on-clickBooleanfalseAny click within the side-nav will close it
fixedBooleanfalseshould always show on large screens
is-openedBooleanfalseopens or closes the side-nav - use in conjuction withtoggled event
rightBooleanfalseattach to the right side instead of the left
transitionFunctionno-transitionwill be called on open and close with{el,style,cb}.
classvue class["side-nav"]class of theul
stylevue style[]style of theul
idString-id of theul
opacityNumber0.5opacity of the overlay
z-indexNumber1000minimum zIndex of the overlay, cannot be lower than 100 (seevue-overlay for specifics)

Menu will be visibile when either is-fixed or is-opened is true.

Events

Namedescription
before-enterwill be called before open animation
after-enterwill be called when opened
before-leavewill be called before close animation
after-leavewill be called when closed
fixed(isFixed:Boolean)emitted when menu get fixed or unfixed on large screen.
toggled(isOpened:Boolean)emitted when menu gets opened or closed.

Transition

You can provide a transition like this:

Velocity=require("velocity-animate")template:"<side-nav transition='moveIn'></side-nav>",methods:{moveIn:function({el,style,cb}){Velocityel,"stop"Velocityel,style,{duration:300,queue:false,easing:'easeOutQuad',complete:cb}}}

The background is managed byvue-overlay.Seehere for an example on how to change its fading function.

Changelog

  • 2.0.0
    now compatible with vue 2.0.0
    close overlay on destroy

  • 1.1.0
    events are renamed after vue transitions
    added toggled event

  • 1.0.1
    addedz-index prop

  • 1.0.0
    renamedhide-on-screen-size tofixed-screen-size

  • 0.3.0
    renamednot-dismissible tonot-dismissable. addedclose-on-click

Development

Clone repository.

npm installnpm run dev

Browse tohttp://localhost:8080/.

License

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

About

side-nav - done in vue

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp