Commit 19ba77d7 authored by 杨奕's avatar 杨奕 Committed by GitHub

Merge pull request #1023 from QingWei-Li/step/align-center

Step: add align-center, fixed #994
parents 99929d6c 23aa2b61
...@@ -120,6 +120,7 @@ Vertical step bars. ...@@ -120,6 +120,7 @@ Vertical step bars.
| active | Sets the current activation step | number | — | 0 | | active | Sets the current activation step | number | — | 0 |
| process-status | Sets the status of current step | string | wait/process/finish/error/success | process | | process-status | Sets the status of current step | string | wait/process/finish/error/success | process |
| finish-status | Sets the status of end step | string | wait/process/finish/error/success | finish | | finish-status | Sets the status of end step | string | wait/process/finish/error/success | finish |
| align-center | align center | boolean | false, true | false |
### Step Attributes ### Step Attributes
| Attribute | Description | Type | Options | Default | | Attribute | Description | Type | Options | Default |
......
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
| active | 设置当前激活步骤 | number | — | 0 | | active | 设置当前激活步骤 | number | — | 0 |
| process-status | 设置当前步骤的状态 | string | wait/process/finish/error/success | process | | process-status | 设置当前步骤的状态 | string | wait/process/finish/error/success | process |
| finish-status | 设置结束步骤的状态 | string | wait/process/finish/error/success | finish | | finish-status | 设置结束步骤的状态 | string | wait/process/finish/error/success | finish |
| align-center | 标题描述居中对齐 | boolean | false, true | false |
### Step Attributes ### Step Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
......
...@@ -114,7 +114,9 @@ export default { ...@@ -114,7 +114,9 @@ export default {
if (parent.direction === 'horizontal') { if (parent.direction === 'horizontal') {
this.style = { width: space }; this.style = { width: space };
// this.mainOffset = -this.$refs.title.getBoundingClientRect().width / 2 + 16 + 'px'; if (parent.alignCenter) {
this.mainOffset = -this.$refs.title.getBoundingClientRect().width / 2 + 16 + 'px';
}
} else { } else {
if (parent.steps[parent.steps.length - 1] !== this) { if (parent.steps[parent.steps.length - 1] !== this) {
this.style = { height: space }; this.style = { height: space };
......
...@@ -13,6 +13,7 @@ export default { ...@@ -13,6 +13,7 @@ export default {
type: String, type: String,
default: 'horizontal' default: 'horizontal'
}, },
alignCenter: Boolean,
finishStatus: { finishStatus: {
type: String, type: String,
default: 'finish' default: 'finish'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment