1.0.1 • Published 8 years ago

oni.button v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

oni.button

avalon.oniui2 button and buttonset component

npm install oni.button

###button

<ms-button>buttonText</ms-button>
<template ms-widget="{is:'ms-button',type:'labeledIcon',position: 'left',icon:'\&\#xf088;'}">aaa</template>
<xmp ms-widget="{is:'ms-button',type:'labeledIcon',position: 'right',icon:'\&\#xf06b;'}">bbb</xmp>
propdefaulttypedescription
type'text'text','icon','labeledIcon'the type of button
width'auto'numberthe width of the button
position'left''left','right','left-right'this position of icons
size"default""small", "default", "big", "large"the size of the button
disabledfalsebooleanthe state of the button
color"default""primary", "warning", "danger", "success", "info", "inverse", "default"the style of the button, as same as bootstrap
corner2true or numberthe borderRadius value of button

###tricks If you want to display ICON type, you don't write icon or type in the MS-WIDGET configuration, instead of whiting icon text in the <ms-button> innerText directly

<!--no "icon" configuration item-->
<ms-button slot='button' ms-widget="{type:'icon'}">&#xf084;</ms-button>

If you want to display LABELEDICON type, you don't write type in the MS-WIDGET configuration, instead of whiting icon and position configuration item

<!--no "icon" configuration item-->
<ms-button ms-widget="{position: 'left-right',icon:'\&\#xf047;-\&\#xf03e;'}">has labeled</ms-button>

###buttonset

<ms-buttonset ms-widget='{width: 60}'>
    <ms-button slot='button'>按钮1</ms-button>
    <ms-button slot='button'>按钮2</ms-button>
    <ms-button slot='button'>按钮3</ms-button>
</ms-buttonset>
propdefaulttypedescription
isVerticaltruebooleanthe arrangement of the buttons
width'auto'numberthe width of buttons