mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
Steps: update document
This commit is contained in:
parent
75e042b8cb
commit
dc854a4d56
@ -1,12 +1,17 @@
|
|||||||
<style>
|
<style>
|
||||||
.demo-steps {
|
.demo-steps {
|
||||||
.steps-success {
|
.steps-success,
|
||||||
|
.van-icon-location {
|
||||||
color: #06bf04;
|
color: #06bf04;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-button {
|
.van-button {
|
||||||
margin: 15px 0 0 15px;
|
margin: 15px 0 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.van-steps__message + p {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -20,7 +25,7 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
nextStep() {
|
nextStep() {
|
||||||
if (++this.active > 3) this.active = 0;
|
this.active = ++this.active % 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,7 +47,7 @@ Vue.component(Steps.name, Steps);
|
|||||||
|
|
||||||
:::demo 基础用法
|
:::demo 基础用法
|
||||||
```html
|
```html
|
||||||
<van-steps :active="active" icon="logistics" icon-class="steps-success" title="等待商家发货" description="等待商家发货等待商家发货等待商家发货等待商家发货等待商家发货">
|
<van-steps :active="active">
|
||||||
<van-step>买家下单</van-step>
|
<van-step>买家下单</van-step>
|
||||||
<van-step>商家接单</van-step>
|
<van-step>商家接单</van-step>
|
||||||
<van-step>买家提货</van-step>
|
<van-step>买家提货</van-step>
|
||||||
@ -61,7 +66,7 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
nextStep() {
|
nextStep() {
|
||||||
if (++this.active > 3) this.active = 0;
|
this.active = ++this.active % 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,13 +74,19 @@ export default {
|
|||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
#### 只显示步骤条
|
#### 物流描述
|
||||||
|
|
||||||
当你不设置`title`或`description`属性时,就会只显示步骤条,而没有步骤的详细信息。
|
通过`title`和`description`属性来定义物流描述信息
|
||||||
|
|
||||||
:::demo 只显示步骤条
|
:::demo 物流描述
|
||||||
```html
|
```html
|
||||||
<van-steps :active="active">
|
<van-steps
|
||||||
|
:active="active"
|
||||||
|
icon="logistics"
|
||||||
|
icon-class="steps-success"
|
||||||
|
title="等待商家发货"
|
||||||
|
description="物流描述"
|
||||||
|
>
|
||||||
<van-step>买家下单</van-step>
|
<van-step>买家下单</van-step>
|
||||||
<van-step>商家接单</van-step>
|
<van-step>商家接单</van-step>
|
||||||
<van-step>买家提货</van-step>
|
<van-step>买家提货</van-step>
|
||||||
@ -84,38 +95,37 @@ export default {
|
|||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
#### 竖式步骤条
|
#### 竖向步骤条
|
||||||
|
|
||||||
可以通过设置`direction`属性来改变步骤条的显示方式,可选值有`vertical/horizontal`。
|
可以通过设置`direction`属性来改变步骤条的显示方式
|
||||||
|
|
||||||
:::demo 只显示步骤条
|
:::demo 竖向步骤条
|
||||||
```html
|
```html
|
||||||
<van-steps direction="vertical" :active="0" active-color="#f60">
|
<van-steps direction="vertical" :active="0" active-color="#f60">
|
||||||
<van-step>
|
<van-step>
|
||||||
<h3>【城市】最新的物流状态之类的表述哈哈哈哈</h3>
|
<h3>【城市】物流状态1</h3>
|
||||||
<p>2016-07-12 12:12:12</p>
|
<p>2016-07-12 12:40</p>
|
||||||
</van-step>
|
</van-step>
|
||||||
<van-step>
|
<van-step>
|
||||||
<h3>【城市】已经过了的物流状态我是折行我是折行我是折行联系电话:158630099999</h3>
|
<h3>【城市】物流状态2</h3>
|
||||||
<p>2016-07-12 12:12:12</p>
|
<p>2016-07-11 10:00</p>
|
||||||
</van-step>
|
</van-step>
|
||||||
<van-step>
|
<van-step>
|
||||||
<h3>未发货</h3>
|
<h3>快件已发货</h3>
|
||||||
<p>2016-07-12 12:12:12</p>
|
<p>2016-07-10 09:30</p>
|
||||||
</van-step>
|
</van-step>
|
||||||
</van-steps>
|
</van-steps>
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### 高级用法
|
### 高级用法
|
||||||
|
使用`slot`增加自定义内容
|
||||||
可以使用具名`slot`增加自定义内容,其中包含`icon`和`message-extra`。
|
|
||||||
|
|
||||||
:::demo 高级用法
|
:::demo 高级用法
|
||||||
```html
|
```html
|
||||||
<van-steps :active="active" title="等待商家发货">
|
<van-steps :active="active" title="等待商家发货">
|
||||||
<van-icon slot="icon" name="like"></van-icon>
|
<van-icon slot="icon" name="location"></van-icon>
|
||||||
<p slot="message-extra">流程</p>
|
<p slot="message-extra">物流进度</p>
|
||||||
<van-step>买家下单</van-step>
|
<van-step>买家下单</van-step>
|
||||||
<van-step>商家接单</van-step>
|
<van-step>商家接单</van-step>
|
||||||
<van-step>买家提货</van-step>
|
<van-step>买家提货</van-step>
|
||||||
@ -128,13 +138,13 @@ export default {
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| active | 当前激活的步骤,从0开始 | `number` | | |
|
| active | 当前步骤,起始值为0 | `Number` | | |
|
||||||
| icon | 当前步骤的icon | `string` | | |
|
| icon | 当前步骤的icon | `String` | | |
|
||||||
| iconClass | 当前步骤栏为icon添加的类 | `string` | | |
|
| iconClass | 当前步骤栏为icon添加的类 | `String` | | |
|
||||||
| title | 当前步骤从标题 | `string` | | |
|
| title | 当前步骤从标题 | `String` | | |
|
||||||
| description | 当前步骤描述 | `string` | | |
|
| description | 当前步骤描述 | `String` | | |
|
||||||
| direction | 显示方向 | `string` | `horizontal` | `vertical/horizontal` |
|
| direction | 显示方向 | `String` | `horizontal` | `vertical` |
|
||||||
| activeColor | `active`状态时的颜色 | `string` | `#06bf04` | |
|
| activeColor | active状态颜色 | `String` | `#06bf04` | |
|
||||||
|
|
||||||
### Steps Slot
|
### Steps Slot
|
||||||
|
|
||||||
@ -142,4 +152,3 @@ export default {
|
|||||||
|-----------|-----------|
|
|-----------|-----------|
|
||||||
| icon | 自定义icon区域 |
|
| icon | 自定义icon区域 |
|
||||||
| message-extra | 状态栏添加额外的元素 |
|
| message-extra | 状态栏添加额外的元素 |
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user