element/packages/steps/README.md

70 lines
1.7 KiB
Markdown
Raw Normal View History

2016-12-15 15:15:46 +08:00
# element-steps
> A element-steps component for Vue.js.
## Demo
http://element-component.github.io/element-steps
## Installation
```shell
npm i element-steps -D
```
## Usage
```javascript
import Vue from 'vue'
import ElStep from 'element-steps'
2017-09-28 18:01:29 +08:00
import 'element-theme-chalk/dist/step.css'
2016-12-15 15:15:46 +08:00
Vue.use(ElStep)
```
or
```javascript
import Vue from 'vue'
import { ElSteps, ElStep } from 'element-steps'
Vue.component('el-steps', ElSteps)
Vue.component('el-step', ElStep)
```
### Steps Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| space | 每个 step 的间距,不填写将自适应间距 | Number | — | — |
| direction | 显示方向 | string | vertical/horizontal | horizontal |
| active | 设置当前激活步骤 | number | — | 0 |
| process-status | 设置当前步骤的状态 | string | wait/process/finish/error/success | process |
| finish-status | 设置结束步骤的状态 | string | wait/process/finish/error/success | finish |
2017-01-11 18:43:58 +08:00
| align-center | 标题描述居中对齐 | boolean | - | false |
2016-12-15 15:15:46 +08:00
### Step Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| title | 标题 | string | — | — |
| description | 描述性文字 | string | — | — |
| icon | 图标 | Element Icon 提供的图标,如果要使用自定义图标可以通过 slot 方式写入 | string | — |
### Step Slot
| name | 说明 |
|----|----|
| icon | 图标 |
| title | 标题 |
| description | 描述性文字 |
## Development
```shell
make dev
## test
make test
## build
make build
```
# License
[MIT](https://opensource.org/licenses/MIT)