Skip to content

vue.js drawer drawerlayout aside 侧边栏 抽屉

Notifications You must be signed in to change notification settings

bajian/vue-drawer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d7560f7 · Aug 28, 2020

History

5 Commits
Sep 27, 2016
Sep 27, 2016
Sep 27, 2016
Oct 17, 2016
Sep 27, 2016
Sep 27, 2016
Sep 27, 2016
Sep 27, 2016
Sep 27, 2016
Aug 28, 2020
Sep 27, 2016
Oct 17, 2016

Repository files navigation

drawerlayout

a vue.js drawer with more function for vue2.x

A Vue.js project

demo

online-demo

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build
	<!-- drawer-->
    <drawer 
    :show="drawerShow" 
    :pos="pos" :tran="tran"
    @change-show="changeDrawerShow">
    <!-- drawerlayout with slot="drawer"-->
      <div class="layout" slot="drawer" >
        <h2><a href="#">bajian drawer</a></h2>
        <ul>
          <li v-for="item in navItems"><a href="#{{item}}">{{item}}</a></li>
        </ul>
      </div>
      <!-- page content -->
      <button v-on:click="directionFlip">directionChange</button><br><br>
      <button v-on:click="tranFlip">tranChange</button><br><br>
      <button v-on:click="drawerToggle">toggle</button>
    </drawer>


    changeDrawerShow(state) {
      this.drawerShow=state;
    }

Api

Properties

Name Type Default Description
pos String left the position where the drawer is:left/right
tran String overlay the transition that the drawer beharior:overlay/push
show.sync Boolean false the drawer visibility,set true to show the drawer
on-hide Function undefined the drawer hide listener
on-show Function undefined the drawer show listener
change-show Function undefined as vue2.0 deprecated the sync,this event must be called to change drawer state by the component itself
==================== ========= ============ ===================

For detailed explanation on how things work, checkout the guide and docs for vue-loader.