vc-button

Install

npm install vc-button --save
// build version
import vcButton from 'vc-button'
// recommend for *.vue project for small bundle size
import vcButton from 'vc-button/src/Button.vue'
// commonjs
require('./dist/build.min.js')
// script tag
<script src='./dist/build.min.js'></script>

Usage

props

type

type of button

htmlType

valid html type attribute

label

button label

shape

shape of button icon

disabled

button disabled

readonly

button readonly

size

size of button

loading

is loading state?

loadingText

loadingText

style

example

import Vue from 'vue'
import vcButton from 'vc-button/src'
new Vue({
el: '#app',
data () {
return {
label: 'use label, no slot',
type: "warning",
htmlType: 'button',
loading: false,
loadingText: 'loading中',
size: 'middle',
icon: 'remove',
shape: '',
disabled: false,
style: {}
}
},
components: {
vcbutton
}
})
<vc-button
:type="type"
:loading="loading"
:loading-text="loadingText"
:size="size"
:disabled="disabled"
:icon="icon"
:shape="shape"
:style='{ "border-radius": "0px" }'
@click="handleClick('btn1', '@click', 'is slot, costom style')"
>
slot & costom style
</vc-button>