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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-drawer-layout

v1.3.0

Published

A simple drawer layout component for Vue.js

Downloads

329

Readme

vue-drawer-layout

npm npm travis npm npm

A simple DrawerLayout component for Vue.js

中文文档

Demo

http://share.codehuang.com/vue-drawer-layout

Mobile QQ by Alexander Huang(click me or scan the qrcode)

Try it

Click the avatar at the top-left or touch(click) and drag to right(left).

Demo

If the image is not animating, maybe your browser does not supports APNG, you could turn to the GIF demo.

Dependencies

Browser Support

Modern (mobile) browsers and Internet Explorer 10+(due to CSS transition support) and X5 core is supported.

Installation

npm install vue-drawer-layout --save

Usage

The following examples can also be used with CommonJS by replacing ES6-specific syntax with CommonJS equivalents.

import Vue from 'vue'
import DrawerLayout from 'vue-drawer-layout'

Vue.use(DrawerLayout)
// or
import {DrawerLayout} from 'vue-drawer-layout'
Vue.component(DrawerLayout.name, DrawerLayout)

You can easily just set nothing or only drawer-width prop to get a simple drawer.It act above the main content.

<vue-drawer-layout ref="drawer" :drawer-width="800">
  <div class="drawer-content" slot="drawer">
    <!-- drawer-content -->
  </div>
  <div slot="content">
    <!-- main-content -->
  </div>
</vue-drawer-layout>

Or you can set every prop as you want to get a fantastic drawer like mobile QQ has(It act below the main content and with distance is 1/3 of the main content drag).

<vue-drawer-layout
  ref="drawer"
  :drawer-width="800"
  :enable="true"
  :animatable="true"
  :z-index="0"
  :drawable-distance="Math.floor(800/3)"
  :content-drawable="true"
  :backdrop="true"
  :backdrop-opacity-range="[0,0.4]"
  @slide-start="handleSlideStart"
  @slide-move="handleSlideMove"
  @slide-end="handleSlideEnd"
  @mask-click="handleMaskClick">
    <div class="drawer-content" slot="drawer">
      <!-- drawer-content -->
    </div>
    <div slot="content">
      <!-- main-content -->
    </div>
</vue-drawer-layout>

API

Props

| Name | Info | Type | Default | |-----------|-----------|-----------|-------------| | drawer-width | width of drawer(px) | Number | 80% of the container(parentNode) width | | drawable-distance | farthest distance to draw(px) | Number | same as drawer-width prop | | z-index | z-index of drawer | Number | 818(Don't Ask^_^) | | content-drawable | whether to make content-wrapper drawable | Boolean | false | | backdrop | whether to show backdrop | Boolean | true | | backdrop-opacity-range | the opacity range of backdrop[min,max] | Array | [0,0.4] | | enable | is drawer enable | Boolean | true | | animatable | is drawer animate during moving | Boolean | true | | reverse | is drawer slide out from right | Boolean | false |

Slots

| Name | Info | |-----------|-----------| | drawer | content in drawer-content | | content | content in main-content |

Methods

| Name | Info | Arguments | Usage | |-----------|-----------|-----------|-----------| | toggle | method to show and hide drawer | visible(Boolean) | toggle(true/false) or toggle()to show(hide) |

Events

| Name | Info | Callback Arguments | |-----------|-----------|-----------| | slide-start | drawer start to slide (fired when touchdown) | - | | slide-move | drawer sliding (fired when touchmove) | pos(int) | | slide-end | drawer sliding (fired when touchend or transitionend) | visible(boolean) | | mask-click | touch(click) on mask | - |

License

MIT License.

Copyright (c) 2018 Alexander Huang.