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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ophiuchus/steps

v1.0.1

Published

### 介绍

Downloads

1

Readme

Steps 步骤条

介绍

用于展示操作流程的各个环节,让用户了解当前的操作在整体流程中的位置。

引入

// 方式1(推荐)
import Vue from 'vue';
import Steps from '@ophiuchus/steps';

Vue.use(Steps);

// 方式2
import Vue from 'vue';
import { Step, Steps } from '@ophiuchus/collapse';

Vue.component(Step.name, Step);
Vue.component(Steps.name, Steps);

代码演示

基础用法

active 属性表示当前步骤的索引,从 0 起计。

<sf-steps :active="active">
  <sf-step>买家下单</sf-step>
  <sf-step>商家接单</sf-step>
  <sf-step>买家提货</sf-step>
  <sf-step>交易完成</sf-step>
</sf-steps>
export default {
  data() {
    return {
      active: 1,
    };
  },
};

自定义样式

可以通过 active-iconactive-color 属性设置激活状态下的图标和颜色。

<sf-steps :active="active" active-icon="success" active-color="#38f">
  <sf-step>买家下单</sf-step>
  <sf-step>商家接单</sf-step>
  <sf-step>买家提货</sf-step>
  <sf-step>交易完成</sf-step>
</sf-steps>

竖向步骤条

可以通过设置 direction 属性来改变步骤条的显示方向。

<sf-steps direction="vertical" :active="0">
  <sf-step>
    <h3>【城市】物流状态1</h3>
    <p>2016-07-12 12:40</p>
  </sf-step>
  <sf-step>
    <h3>【城市】物流状态2</h3>
    <p>2016-07-11 10:00</p>
  </sf-step>
  <sf-step>
    <h3>快件已发货</h3>
    <p>2016-07-10 09:30</p>
  </sf-step>
</sf-steps>

API

Steps Props

| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | active | 当前步骤 | number | string | 0 | | direction | 显示方向,可选值为 vertical | string | horizontal | | active-color | 激活状态颜色 | string | #07c160 | | inactive-color | 未激活状态颜色 | string | #969799 | | active-icon | 激活状态底部图标,可选值见 Icon 组件 | string | checked | | inactive-icon | 未激活状态底部图标,可选值见 Icon 组件 | string | - | | finish-icon | 已完成步骤对应的底部图标,优先级高于 inactive-icon,可选值见 Icon 组件 | string | - | | icon-prefix | 图标类名前缀,同 Icon 组件的 class-prefix 属性 | string | sf-icon |

Step Slots

| 名称 | 说明 | | --- | --- | | active-icon | 自定义激活状态图标 | | inactive-icon | 自定义未激活状态图标 | | finish-icon | 自定义已完成步骤对应的底部图标,优先级高于 inactive-icon |

Steps Events

| 事件名 | 说明 | 回调参数 | | ------------------- | -------------------------- | --------------- | | click-step | 点击步骤的标题或图标时触发 | index: number |

样式变量

组件提供了下列 Less 变量,可用于自定义样式,使用方法请参考主题定制

| 名称 | 默认值 | 描述 | | -------------------------------- | --------------- | ---- | | @step-text-color | @gray-6 | - | | @step-active-color | @green | - | | @step-process-text-color | @text-color | - | | @step-font-size | @font-size-md | - | | @step-line-color | @border-color | - | | @step-finish-line-color | @green | - | | @step-finish-text-color | @text-color | - | | @step-icon-size | 12px | - | | @step-circle-size | 5px | - | | @step-circle-color | @gray-6 | - | | @step-horizontal-title-font-size | @font-size-sm | - | | @steps-background-color | @white | - |