vt-button

1.1.5 • Public • Published

vt-button

基于 vue 2 封装出的 button 组件,提供了基本的样式和事件。

Install

npm i vt-button -S
 
import Buttons from 'vt-button'
 
// global install
Vue.component('Buttons', Buttons)
 
// scope install
export default {
    components: {
        Buttons
    }
}

Usage

<template>
    <Buttons @click="clickMe">click</Buttons>
    <Buttons disabled>disabled</Buttons>
    <Buttons html-type="submit" @click="submitMe">submit</Buttons>
    <Buttons size="small">small</Buttons>
    <hr />
    <Buttons type="primary">primary</Buttons>
    <Buttons type="success">success</Buttons>
    <Buttons type="loading">loading</Buttons>
    <Buttons type="warning">warning</Buttons>
    <Buttons type="info">info</Buttons>
    <Buttons type="danger">danger</Buttons>
</template>
 
<script>
    import Buttons from 'src'
 
    export default {
        methods: {
            clickMe() {
                alert('点击演示')
            },
            submitMe(event) {
                alert(event.target.type)
            }
        },
        components: {
            Buttons
        }
    }
</script>

Interface

props:
  type:
    type: String
    default: ''
    description: 按钮的类型,可选值: ``primary``,``success``,``loading``,``warning``,``info``,``danger``
  disabled:
    type: Boolean
    default: false
    description: 是否置灰按钮
  size:
    type: String
    default: ''
    description: 按钮的大小,可选值: ``small``,``large`` 和 ``mini``
  htmlType:
    type: String
    default: button
    description: 按钮原生的 Type 值,可选值: ``button``,``submit`` 和 ``reset``
slots:
  default:
    description: 按钮文字
events:
  click:
    description: 按钮点击事件,在移动端有 300ms 延迟

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.52latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.52
1.1.40
1.1.20
1.1.10
1.1.00
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i vt-button

Weekly Downloads

2

Version

1.1.5

License

MIT

Last publish

Collaborators

  • jerret321