# Button按钮

基础组件，触发业务逻辑时使用。


### 按钮种类

::: demo 按钮两种类型 主按钮、幽灵按钮 
```html
<template>
    <ut-button>主按钮</ut-button>
    <ut-button plain>幽灵按钮</ut-button>
</template>
```
:::

### 颜色种类

::: demo 通过设置type为primary、info、success、warning、danger创建不同样式的按钮，不设置为默认样式。

```html
<template>
    <div style='padding-bottom:10px;border-bottom:1px solid #eee;margin-bottom:10px'>
        <ut-button>默认按钮</ut-button>
        <ut-button type='primary'>主要按钮</ut-button>
        <ut-button type='info'>信息按钮</ut-button>
        <ut-button type='success'>信息按钮</ut-button>
        <ut-button type='warning'>警告按钮</ut-button>
        <ut-button type='danger'>错误按钮</ut-button>
    </div>
    <div>
        <ut-button plain>默认按钮</ut-button>
        <ut-button type='primary' plain>主要按钮</ut-button>
        <ut-button type='info' plain>信息按钮</ut-button>
        <ut-button type='success' plain>信息按钮</ut-button>
        <ut-button type='warning' plain>警告按钮</ut-button>
        <ut-button type='danger' plain>错误按钮</ut-button>
    </div>
</template>
```
:::

### 按钮大小

::: demo 按钮有大、中、小三种尺寸。通过设置 size 为 large small 分别把按钮设为大、小尺寸。若不设置 size，则尺寸为中。
```html
<template>
    <ut-button type='primary' size='large'>大按钮</ut-button>
    <ut-button type='primary'>正常按钮</ut-button>
    <ut-button type='primary' size='small'>小按钮</ut-button>
</template>
```
:::

### 不可用状态

::: demo 添加 disabled 属性即可让按钮处于不可用状态，同时按钮样式也会改变。
```html
<template>
    <ut-button type='primary' size='large' disabled>大按钮</ut-button>
    <ut-button type='primary' disabled>正常按钮</ut-button>
    <ut-button type='primary' size='small' disabled>小按钮</ut-button>
</template>
```
:::

### 按钮组合

::: demo 将多个Button放入ButtonGroup内，可实现按钮组合的效果。
```html
<template>
    <ut-button-group>
        <ut-button type='primary'>精选</ut-button>
        <ut-button type='primary'>历史</ut-button>
    </ut-button-group>
    <ut-button-group>
        <ut-button type='primary' disabled>上一页</ut-button>
        <ut-button type='info'>1</ut-button>
        <ut-button type='info'>2</ut-button>
        <ut-button type='info'>3</ut-button>
        <ut-button type='info'>4</ut-button>
        <ut-button type='info'>5</ut-button>
        <ut-button type='info'>6</ut-button>
        <ut-button type='info'>下一页</ut-button>
    </ut-button-group>
</template>
```
:::