uView Steps 步骤条

简介: uView Steps 步骤条

该组件一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。

#平台差异说明

App(vue) App(nvue) H5 小程序

#基本使用

说明

由于安卓nvue下,overflow属性不支持visible值,故此组件暂不支持安卓nvue环境。

  • 通过current参数标识目前处于第几步,从0开始
<template>
  <u-steps current="0">
    <u-steps-item title="已下单" desc="10:30">
    </u-steps-item>
    <u-steps-item title="已出库" desc="10:35" ></u-steps-item>
    <u-steps-item title="运输中" desc="11:40"></u-steps-item>
  </u-steps>
</template>

copy

#错误状态

如果设置u-steps-itemerror参数为true的话,当前步骤将会为“失败”的状态

<u-steps current="1">
  <u-steps-item title="已下单" desc="10:30"></u-steps-item>
  <u-steps-item error title="仓库着火" desc="10:35"></u-steps-item>
  <u-steps-item title="破产清算" desc="11:40"></u-steps-item>
</u-steps>

copy

#步骤条模式

u-stepsdot参数设置为true的话,将会以点状的形式展示步骤条样式。

<u-steps current="1" dot>
  <u-steps-item title="已下单" desc="10:30"></u-steps-item>
  <u-steps-item title="已出库" desc="10:35"></u-steps-item>
  <u-steps-item title="运输中" desc="11:40"></u-steps-item>
</u-steps>

copy

#竖向模式

u-stepsdirection参数设置为column的话,组件将会以竖向的形式展示步骤条内容。

<template>
  <u-steps current="1" direction="column">
    <u-steps-item title="已下单" desc="10:30">
    </u-steps-item>
    <u-steps-item title="已出库" desc="10:35">
    </u-steps-item>
    <u-steps-item title="运输中" desc="11:40"></u-steps-item>
  </u-steps>
</template>

copy

#自定义图标

  • 通过activeIcon可以设置激活状态的图标
  • 通过inactiveIcon可以设置非激活状态的图标
<u-steps
  current="1" activeIcon="checkmark" inactiveIcon="arrow-right">
  <u-steps-item title="已下单" desc="10:30"></u-steps-item>
  <u-steps-item title="已出库" desc="10:35"></u-steps-item>
  <u-steps-item title="运输中" desc="11:40"></u-steps-item>
</u-steps>

copy

#通过插槽自定义样式

通过默认插槽,可以自定义某个步骤当前状态的特殊标识

<u-steps :current="1">
  <u-steps-item title="已下单" desc="10:30"></u-steps-item>
  <u-steps-item title="已出库" desc="10:35"></u-steps-item>
  <u-steps-item title="运输中" desc="11:40">
    <text class="slot-icon" slot="icon">运</text>
  </u-steps-item>
</u-steps>
<style lang="scss">
  .slot-icon {
    width: 21px;
    height: 21px;
    background-color: $u-warning;
    border-radius: 100px;
    font-size: 12px;
    color: #fff;
    line-height: 21px;
    text-align: center;
  }
</style>
相关文章
|
小程序 搜索推荐
uniapp中如何使用image图片
uniapp中如何使用image图片
3053 0
|
开发框架 移动开发 小程序
uniapp实现上传文件功能
uniapp实现上传文件功能
1693 0
|
移动开发 Android开发 iOS开发
uniapp开发H5及app监听返回事件(以及监听不到的处理方法)
uniapp开发H5及app监听返回事件(以及监听不到的处理方法)
4595 0
Vue2步骤条(Steps)
这是一个基于 Vue3 的步骤条(Steps)组件,支持高度自定义。主要属性包括步骤标题数组(stepsLabel)、步骤描述数组(stepsDesc)、步骤总数(totalSteps,默认为3)、当前选中的步骤(currentStep,默认为1)、步骤条总宽度(totalWidth,默认为900px)和描述文本最大宽度(descMaxWidth,默认为140px)。组件通过不同的样式展示已完成、进行中和未开始的状态,并支持点击切换步骤。可在需要的页面中引入并传入相关初始数据。
544 1
Vue2步骤条(Steps)
|
JavaScript
基于Vue2超简单实现DIY定制的步骤条
这篇文章介绍了如何在Vue 2中实现一个自定义设计的步骤条组件,包括子组件的设计和在父页面中的使用示例。
557 1
基于Vue2超简单实现DIY定制的步骤条
|
小程序 API 数据安全/隐私保护
微信小程序开发中的一些常用标签
这些标签是微信小程序开发中的基础,开发者可以根据需要组合使用这些标签来构建小程序的界面。每个标签都有其属性和事件,可以通过属性来调整组件的样式和行为,通过事件来响应用户的操作。
963 5
Vue3步骤条(Steps)
这是一个基于 Vue2 的步骤条(Steps)组件,支持多种自定义属性,如步骤数组、宽度、大小、垂直显示、标签位置等。通过 `v-model` 可实现步骤的动态切换和点击交互。提供了丰富的样式调整选项,适用于各种场景下的多步骤流程引导。组件内详细展示了如何创建和使用步骤条,并提供了多个示例代码片段。
2121 4
Vue3步骤条(Steps)
|
存储 监控 固态存储
如何在 Linux 上检查 SSD/HDD 健康状况?
【10月更文挑战第14天】
2564 1
如何在 Linux 上检查 SSD/HDD 健康状况?
uni-app动态修改顶部原生导航栏文字跟颜色
uni-app动态修改顶部原生导航栏文字跟颜色
1522 0
|
数据挖掘
uniapp uview扩展u-picker支持日历期间 年期间 月期间 时分期间组件
uniapp uview扩展u-picker支持日历期间 年期间 月期间 时分期间组件
1540 10