Skip to content

Commit

Permalink
docs: ✏️ Steps步骤条增加控制进度的示例
Browse files Browse the repository at this point in the history
  • Loading branch information
xuqingkai committed Apr 7, 2024
1 parent f979ccc commit 8025174
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions docs/component/steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@
`active` 为步骤进度,为 number 类型,步骤的下标。

```html
<wd-steps :active="0">
<wd-steps :active="active">
<wd-step />
<wd-step />
<wd-step />
</wd-steps>
```

```ts
const active = ref<number>(0)

function nextStep() {
active.value = active.value + 1
}

```

## 水平居中

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

```html
<wd-steps :active="0" align-center>
<wd-steps :active="active" align-center>
<wd-step title="步骤1" description="注册1个账号" />
<wd-step title="步骤2" description="登录账号并绑定手机" />
<wd-step title="步骤3" description="完善个人信息" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<text v-else>{{ currentTitle }}</text>
</view>
<view v-if="$slots.description || description" class="wd-step__description">
<slot v-if="$slots.description" name="description"/>
<slot v-if="$slots.description" name="description" />
<text v-else>{{ description }}</text>
</view>
</view>
Expand Down

0 comments on commit 8025174

Please sign in to comment.