Skip to content

Commit 8025174

Browse files
author
xuqingkai
committed
docs: ✏️ Steps步骤条增加控制进度的示例
1 parent f979ccc commit 8025174

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

docs/component/steps.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,22 @@
1212
`active` 为步骤进度,为 number 类型,步骤的下标。
1313

1414
```html
15-
<wd-steps :active="0">
15+
<wd-steps :active="active">
1616
<wd-step />
1717
<wd-step />
1818
<wd-step />
1919
</wd-steps>
2020
```
2121

22+
```ts
23+
const active = ref<number>(0)
24+
25+
function nextStep() {
26+
active.value = active.value + 1
27+
}
28+
29+
```
30+
2231
## 水平居中
2332

2433
设置 `align-center` 水平居中,只对横向步骤条有效。
@@ -36,7 +45,7 @@
3645
可以通过 `title``description` 设置步骤的标题和描述信息。如果不设置标题,则会使用默认的文案。
3746

3847
```html
39-
<wd-steps :active="0" align-center>
48+
<wd-steps :active="active" align-center>
4049
<wd-step title="步骤1" description="注册1个账号" />
4150
<wd-step title="步骤2" description="登录账号并绑定手机" />
4251
<wd-step title="步骤3" description="完善个人信息" />

src/uni_modules/wot-design-uni/components/wd-step/wd-step.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<text v-else>{{ currentTitle }}</text>
2626
</view>
2727
<view v-if="$slots.description || description" class="wd-step__description">
28-
<slot v-if="$slots.description" name="description"/>
28+
<slot v-if="$slots.description" name="description" />
2929
<text v-else>{{ description }}</text>
3030
</view>
3131
</view>

0 commit comments

Comments
 (0)