diff --git a/docs/examples-docs/steps.md b/docs/examples-docs/steps.md index eebe46708..6fa81f664 100644 --- a/docs/examples-docs/steps.md +++ b/docs/examples-docs/steps.md @@ -111,6 +111,29 @@ export default { ``` ::: +#### 竖式步骤条 + +可以通过设置`direction`属性来改变步骤条的显示方式,可选值有`vertical/horizontal`。 + +:::demo 只显示步骤条 +```html + + +

【城市】最新的物流状态之类的表述哈哈哈哈

+

2016-07-12 12:12:12

+
+ +

【城市】已经过了的物流状态我是折行我是折行我是折行联系电话:158630099999

+

2016-07-12 12:12:12

+
+ +

未发货

+

2016-07-12 12:12:12

+
+
+``` +::: + ### 高级用法 可以使用具名`slot`增加自定义内容,其中包含`icon`和`message-extra`。 @@ -137,6 +160,8 @@ export default { | iconClass | 当前步骤栏为icon添加的类 | `string` | | | | title | 当前步骤从标题 | `string` | | | | description | 当前步骤描述 | `string` | | | +| direction | 显示方向 | `string` | `horizontal` | `vertical/horizontal` | +| activeColor | `active`状态时的颜色 | `string` | `#06bf04` | | ### Steps Slot diff --git a/packages/steps/src/step.vue b/packages/steps/src/step.vue index 5dd205e3d..39c800014 100644 --- a/packages/steps/src/step.vue +++ b/packages/steps/src/step.vue @@ -1,12 +1,12 @@ @@ -30,9 +30,18 @@ export default { return 'process'; } }, - statusClass() { + stepClass() { const status = this.status; - return status ? 'van-step--' + status : ''; + const statusClass = status ? 'van-step--' + status : ''; + const directionClass = `van-step--${this.$parent.direction}`; + return [directionClass, statusClass]; + }, + titleStyle() { + if (this.status === 'process') { + return { + color: this.$parent.activeColor + }; + } } } }; diff --git a/packages/steps/src/steps.vue b/packages/steps/src/steps.vue index 2fd212148..bfca083fa 100644 --- a/packages/steps/src/steps.vue +++ b/packages/steps/src/steps.vue @@ -1,5 +1,5 @@