1.0.1 • Published 5 years ago

vue-drawer-component v1.0.1

Weekly downloads
9
License
ISC
Repository
github
Last release
5 years ago

vue-drawer-component

一个基于vue实现的抽屉组件

image

点击查看在线demo

Install

npm install vue-drawer-component -S

Quick Start

import VueDrawer from 'vue-drawer-component'
import 'vue-drawer-component/src/index.css'

Vue.component(VueDrawer.name, VueDrawer)

基础用法

<template>
  <div>
    <vue-drawer :visible.sync="visible">
      <div slot="header">
        Basic Drawer
      </div>
      <div slot="body">
        <p>Some contents...</p>
        <p>Some contents...</p>
        <p>Some contents...</p>
      </div>
    </vue-drawer>
  </div>
</template>

<script>
export default {
  data () {
    return {
      visible: false
    }
  }
}
</script>

API

Props:

属性说明 类型 默认值
visible是否显示抽屉Booleanfalse
placement抽屉的方向'top''right''bottom''left''right'
header-footer-fixed头部与底部是否固定Booleantrue
mask-closable点击蒙层是否允许关闭Booleantrue
mask是否展示遮罩Booleantrue
width宽度String, Number256
height高度, 在 placement 为 top 或 bottom 时使用String, Number256
zIndex设置 Drawer 的 z-indexNumber1000
afterClose关闭之后的回调Function--
beforeClose关闭之前的回调,可用于做拦截,一定要调用next钩子Function(next)--

作者wx: ckang1229