0.0.3 • Published 3 years ago

peach-split-button v0.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

peach-split-button

vue 悬停分割按钮 split button with hover effect component for Vue.js

在线预览 | Preview demo

https://taoqi0813.github.io/#/peach-split-button

快速上手 | Getting started

安装 | Installation

npm install -S peach-split-button

在 main.js 引用 | In Main.js:

import PeachSplitBtn from 'peach-split-button'
Vue.use(PeachSplitBtn)

用法 | Usage

<peach-split-btn
  :label="label"
  :active="active"
  :split="split"
  :width="width"
  :left="left"
  :top="top"
  :z-index="zIndex"
  :bg-color="bgColor"
  :text-color="textColor"
  :custom-class="customClass"
  :click-func="btnClick"
>
  这里用slot自己插菜单
</peach-split-btn>

配置 | Options

  • label

    • 按钮的文本 | main-button label
    • 类型: String | Type: String
    • 默认值: '' | Default: ''
    • 可用插槽替代,slot="label"
  • active

    • 激活状态 | button active state
    • 类型: Boolean | Type: Boolean
    • 默认值: false | Default: false
  • split

    • 是否分割 | split button or not
    • 类型: Boolean | Type: Boolean
    • 默认值: true | Default: true
  • width

    • 按钮宽度 | button width
    • 类型: String, Number | Type: String, Number
    • 不要带单位,固定 px | no unit, is 'px'
    • 默认值: 120 | Default: 120
  • left

  • top

  • z-index

  • bg-color

    • 按钮背景色 | button background color
    • 类型: String | Type: String
    • 默认值: '#1976d2' | Default: '#1976d2'
  • text-color

    • 按钮文本色 | button color
    • 类型: String | Type: String
    • 默认值: '#fff' | Default: '#fff'
  • custom-class

    • 按钮自定义 class | button custom class
    • 类型: String | Type: String
    • 默认值: '' | Default: ''
  • click-func

    • 主按钮点击事件回调函数 | main-button click function
    • 类型: Function | Type: Function
    • 回调参数: click event | Arg: click event

插槽 | slots

slot="default"

  • 菜单 | menu

slot="label"

  • 按钮文本 | button label

更新日志 | Log

版本号更新时间更新内容
0.1.22021/1/26去掉 menu 默认样式,增加 custom-class 属性
0.1.12021/1/14增加 z-index 属性
0.1.02021/1/13初始化项目