npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tanzhenxing/zx-step

v1.0.3

Published

步骤条的子组件,表示一个单独的步骤,必须配合 zx-steps 组件使用。支持水平和垂直方向、居中对齐、自定义图标、多种状态等功能。

Readme

zx-step 步骤组件

步骤条的子组件,表示一个单独的步骤,必须配合 zx-steps 组件使用。

简介

zx-step 组件是 zx-steps 步骤条组件的子组件,用于表示步骤条中的单个步骤。它支持多种显示模式、状态和自定义内容,可以帮助用户清晰地了解当前流程的进度。

特性

  • ✅ 支持水平和垂直方向
  • ✅ 支持居中对齐
  • ✅ 自定义图标
  • ✅ 多种状态显示(等待/处理中/完成/错误/成功)
  • ✅ 简洁模式
  • ✅ 自定义插槽
  • ✅ 跨端兼容

安装方法

将组件复制到项目的 components 目录中,并确保同时安装 zx-steps 组件。

基础用法

<template>
  <zx-steps :active="1" finish-status="success">
    <zx-step title="步骤1" description="这是第一步的描述"></zx-step>
    <zx-step title="步骤2" description="这是第二步的描述"></zx-step>
    <zx-step title="步骤3" description="这是第三步的描述"></zx-step>
  </zx-steps>
</template>

<script setup>
import ZxSteps from '@/components/zx-steps/zx-steps.vue';
import ZxStep from '@/components/zx-step/zx-step.vue';
</script>

垂直方向

<template>
  <view style="height: 300px;">
    <zx-steps direction="vertical" :active="1">
      <zx-step title="步骤1" description="这是第一步的描述"></zx-step>
      <zx-step title="步骤2" description="这是第二步的描述"></zx-step>
      <zx-step title="步骤3" description="这是第三步的描述"></zx-step>
    </zx-steps>
  </view>
</template>

简洁模式

简洁模式下不显示描述文案。

<template>
  <zx-steps :active="1" simple>
    <zx-step title="步骤1"></zx-step>
    <zx-step title="步骤2"></zx-step>
    <zx-step title="步骤3"></zx-step>
  </zx-steps>
</template>

自定义图标

可以使用 icon 属性设置自定义图标。

<template>
  <zx-steps :active="1">
    <zx-step title="步骤1" icon="✏️"></zx-step>
    <zx-step title="步骤2" icon="⬆️"></zx-step>
    <zx-step title="步骤3" icon="🖼️"></zx-step>
  </zx-steps>
</template>

自定义状态

可以单独为每个步骤设置状态,优先级高于 zx-steps 组件的状态设置。

<template>
  <zx-steps>
    <zx-step title="步骤1" status="finish"></zx-step>
    <zx-step title="步骤2" status="error"></zx-step>
    <zx-step title="步骤3" status="wait"></zx-step>
  </zx-steps>
</template>

动态控制

<template>
  <zx-steps :active="active" finish-status="success">
    <zx-step title="步骤 1"></zx-step>
    <zx-step title="步骤 2"></zx-step>
    <zx-step title="步骤 3"></zx-step>
  </zx-steps>
  <button @click="next">下一步</button>
</template>

<script setup>
import { ref } from 'vue';
const active = ref(0);
const next = () => {
  active.value = (active.value + 1) % 4;
};
</script>

API

属性

| 属性名 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | title | 步骤标题 | String | - | | description | 步骤描述文案,简洁模式下不显示 | String | - | | icon | 自定义图标,如果设置则覆盖默认的数字图标 | String | - | | status | 设置当前步骤的状态,可选值为 wait/process/finish/error/success | String | - |

插槽

| 插槽名 | 说明 | | --- | --- | | default | 默认插槽 | | title | 自定义标题内容 | | description | 自定义描述内容 | | icon | 自定义图标内容 |

注意事项

  1. zx-step 组件必须作为 zx-steps 组件的子组件使用
  2. 每个 zx-step 的状态由父组件 zx-stepsactive 属性和 process-status/finish-status 控制
  3. 也可以通过单独设置 status 属性来覆盖父组件状态
  4. 简洁模式下,description 属性将不会显示
  5. 所有状态对应的样式颜色:
    • process: #409eff (蓝色)
    • finish/success: #67c23a (绿色)
    • error: #f56c6c (红色)
    • wait: #c0c4cc (灰色)

相关组件