038_Steps步骤条

article/2025/9/17 22:07:56

1. Steps步骤条

1.1. Steps步骤条引导用户按照流程完成任务的分步导航条, 可根据实际应用场景设定步骤, 步骤不得少于2步。

1.2. Steps Attributes

参数

说明

类型

可选值

默认值

space

每个step的间距, 不填写将自适应间距。支持百分比。

number / string

direction

显示方向

string

vertical/horizontal

horizontal

active

设置当前激活步骤

number

0

process-status

设置当前步骤的状态

string

wait / process / finish / error / success

process

finish-status

设置结束步骤的状态

string

wait / process / finish / error / success

finish

align-center

进行居中对齐

boolean

false

simple

是否应用简洁风格

boolean

false

1.3. Step Attributes

参数

说明

类型

可选值

title

标题

string

description

描述性文字

string

icon

图标

传入icon的class全名来自定义icon, 也支持slot方式写入

string

status

设置当前步骤的状态, 不设置则根据steps确定状态

wait / process / finish / error / success

1.4. Step Slot

Name

说明

icon

自定义图标

title

自定义标题

description

自定义描述性文字

2. Steps步骤条例子

2.1. 使用脚手架新建一个名为element-ui-steps的前端项目, 同时安装Element插件。

2.2. 编辑index.js 

import Vue from 'vue'
import VueRouter from 'vue-router'
import Steps from '../components/Steps.vue'
import TitleSteps from '../components/TitleSteps.vue'
import DescriptionSteps from '../components/DescriptionSteps.vue'
import IconSteps from '../components/IconSteps.vue'
import VerticalSteps from '../components/VerticalSteps.vue'
import SimpleSteps from '../components/SimpleSteps.vue'Vue.use(VueRouter)const routes = [{ path: '/', redirect: '/Steps' },{ path: '/Steps', component: Steps },{ path: '/TitleSteps', component: TitleSteps },{ path: '/DescriptionSteps', component: DescriptionSteps },{ path: '/IconSteps', component: IconSteps },{ path: '/VerticalSteps', component: VerticalSteps },{ path: '/SimpleSteps', component: SimpleSteps }
]const router = new VueRouter({routes
})export default router

2.3. 在components下创建Steps.vue

<template><div><h1>基础用法</h1><h4>设置active属性, 接受一个Number, 表明步骤的index, 从0开始。需要定宽的步骤条时, 设置space属性即可, 它接受Number, 单位为px, 如果不设置, 则为自适应。设置finish-status属性可以改变已经完成的步骤的状态。</h4><el-steps :active="active" finish-status="success"><el-step title="步骤 1"></el-step><el-step title="步骤 2"></el-step><el-step title="步骤 3"></el-step></el-steps><el-button style="margin-top: 12px;" @click="next">下一步</el-button></div>
</template><script>
export default {data () {return {active: 0}},methods: {next () {if (this.active++ > 2) this.active = 0}}
}
</script>

2.4. 在components下创建TitleSteps.vue

<template><div><h1>含状态步骤条</h1><h4>也可以使用title具名分发, 可以用slot的方式来取代属性的设置, 在本文档最后的列表中有所有的slot name可供参考。</h4><el-steps :space="200" :active="1" finish-status="success"><el-step title="已完成"></el-step><el-step title="进行中"></el-step><el-step title="步骤 3"></el-step></el-steps></div>
</template>

2.5. 在components下创建DescriptionSteps.vue

<template><div><h1>有描述的步骤条</h1><h4>description设置每个步骤有其对应的步骤状态描述。</h4><el-steps :active="1"><el-step title="步骤 1" description="这是一段很长很长很长的描述性文字"></el-step><el-step title="步骤 2" description="这是一段很长很长很长的描述性文字"></el-step><el-step title="步骤 3" description="这段就没那么长了"></el-step></el-steps><h1>居中的步骤条</h1><h4>align-center进行居中对齐, 标题和描述都将居中。</h4><el-steps :active="2" align-center><el-step title="步骤1" description="这是一段很长很长很长的描述性文字"></el-step><el-step title="步骤2" description="这是一段很长很长很长的描述性文字"></el-step><el-step title="步骤3" description="这是一段很长很长很长的描述性文字"></el-step><el-step title="步骤4" description="这是一段很长很长很长的描述性文字"></el-step></el-steps></div>
</template>

2.6. 在components下创建IconSteps.vue

<template><div><h1>带图标的步骤条</h1><h4>通过icon属性来设置图标, 图标的类型可以参考Icon组件的文档, 除此以外, 还能通过具名slot来使用自定义的图标。</h4><el-steps :active="1"><el-step title="步骤 1" icon="el-icon-edit"></el-step><el-step title="步骤 2" icon="el-icon-upload"></el-step><el-step title="步骤 3" icon="el-icon-picture"></el-step></el-steps></div>
</template>

2.7. 在components下创建VerticalSteps.vue

<template><div><h1>竖式步骤条</h1><h4>只需要在el-steps元素中设置direction属性为vertical即可。</h4><div style="height: 300px;"><el-steps direction="vertical" :active="1"><el-step title="步骤 1"></el-step><el-step title="步骤 2"></el-step><el-step title="步骤 3" description="这是一段很长很长很长的描述性文字"></el-step></el-steps></div></div>
</template>

2.8. 在components下创建SimpleSteps.vue

<template><div><h1>简洁风格的步骤条</h1><h4>设置simple可应用简洁风格, 该条件下align-center / description / direction / space都将失效。</h4><el-steps :active="1" simple><el-step title="步骤 1" icon="el-icon-edit"></el-step><el-step title="步骤 2" icon="el-icon-upload"></el-step><el-step title="步骤 3" icon="el-icon-picture"></el-step></el-steps><el-steps :active="1" finish-status="success" simple style="margin-top: 20px"><el-step title="步骤 1" ></el-step><el-step title="步骤 2" ></el-step><el-step title="步骤 3" ></el-step></el-steps></div>
</template>

2.9. 运行项目, 访问http://localhost:8080/#/Steps

2.10. 运行项目, 访问http://localhost:8080/#/TitleSteps

2.11. 运行项目, 访问http://localhost:8080/#/DescriptionSteps 

2.12. 运行项目, 访问http://localhost:8080/#/IconSteps 

2.13. 运行项目, 访问http://localhost:8080/#/VerticalSteps 

 

2.14. 运行项目, 访问http://localhost:8080/#/SimpleSteps


http://chatgpt.dhexx.cn/article/c6SSeC9o.shtml

相关文章

更改el-steps颜色样式

原样式&#xff1a; 目标样式如下&#xff0c;也不追求完全一致&#xff0c;至少得看得过去。 <style scoped>::v-deep .el-step__head.is-success {color: rgb(52, 158, 250);border-color: rgb(52, 158, 250); } ::v-deep .el-step__title.is-success {font-weight: …

vue使用steps步骤条,自定义内容

效果图 一、引入element ui steps <el-steps :active"caseHistoryData.length" finish-status"success" direction"vertical" ><el-step><template slot"description"></template></el-step> </el-…

steps.js 步骤条、时间轴

GitHub地址&#xff1a;https://github.com/fxss5201/steps 介绍 首先看一下目录&#xff1a; 1.0 文件夹和 2.0 文件夹非升级关系&#xff0c;两者仅是着重点方向不一致&#xff0c;1.0 主打双边显示&#xff0c;2.0 主打内容排序&#xff0c;一般功能的话两者均可满足。 …

CSS3中steps()动画的详解

原文作者&#xff1a;Joni Trythall 增修作者&#xff1a;Fegmaybe 一个是雪碧图的实现动画的steps效果。steps&#xff08;&#xff09;阶跃函数&#xff0c;是transition-timing-function和animation-timing-function两个属性的属性值&#xff0c;他是表示两个关键帧之间的动…

css【详解】steps()函数

steps(number, position)number 整数值&#xff0c;表示把动画分成了多少段。position 可选参数&#xff0c;表示动画跳跃执行是在时间段的开始还是结束。 —— start 在时间段的开头处跳跃 —— end 在时间段的结束处跳跃 动画效果见 https://demo.cssworld.cn/new/5/4-7.php…

steps函数--参数意思和用法

图片解释如下&#xff0c;参数意思和用法在代码的注释中 所引用图片共7帧&#xff0c;如下&#xff1a; 尺寸为200*1400&#xff0c;所以设置div为200*200&#xff0c;分为7帧&#xff0c;除去展示帧&#xff0c;需六次步骤跳转&#xff0c;原图如下&#xff1a; 代码&…

element的步骤条整合表单(steps+form)

先上效果图&#xff1a; element ui 组件库官网 使用步骤&#xff1a; 1、页面组合步骤 > 5步 定义出4个步骤&#xff08;看你自己需要几步&#xff09;定义form表单定义4个盒子对象active属性 > 1 到 4放置表单项设置上一步和下一步的按钮 <template>//第一步…

vue、Steps 步骤条、Steps 属性、vue Steps 所有步骤条样式、vue Steps 步骤条全部属性

vue、Steps 步骤条、Steps 属性、vue Steps 所有步骤条样式、vue Steps 步骤条全部属性 设计规则何时使用 代码演示1.基本用法2.迷你版3.带图标的步骤条4.步骤切换5.竖直方向的步骤条6.竖直方向的小型步骤条7.步骤运行错误8.点状步骤条9.自定义点状步骤条 APIStepsSteps.Step 设…

组件封装 - steps组件

首先, 我先来看看效果 steps 组件的封装和 tabs 组件还是相似的 都会去指定两个组件来完成(仿Element UI), 都会去使用 jsx 的语法 让其中一个组件去规定样式和排版, 另外一个组件去接收父组件传入的动态数据 但和面包屑组件还是有区别的(面包屑组件封装): 相同点都是使用两…

ElementUi Steps 步骤条的使用

效果&#xff1a; 实现&#xff1a; <el-steps :active"active" finish-status"success"><el-step title"步骤 1"></el-step><el-step title"步骤 2"></el-step><el-step title"步骤 3"&…

el-steps(步骤条)的入门学习

el-steps(步骤条)的入门学习 适用场景 在有步骤流程的情况下&#xff0c;可以设置步骤条&#xff0c;引导用户向下操作&#xff0c;如四六级的报考 知识点 el-steps嵌套el-step使用el-steps的active设置Number&#xff0c;从零开始el-steps的space设置Number&#xff0c;为…

Vue2步骤条(Steps)

Vue3步骤条&#xff08;Steps&#xff09; 可自定义设置以下属性&#xff1a; 步骤标题数组&#xff08;stepsLabel&#xff09;步骤描述数组&#xff08;stepsDesc&#xff09;步骤总数&#xff08;totalSteps&#xff09;&#xff0c;默认3当前选中的步骤&#xff08;curren…

Vue3步骤条(Steps)

Vue2步骤条&#xff08;Steps&#xff09; 可自定义设置以下属性&#xff1a; 步骤数组&#xff08;steps&#xff09;&#xff0c;类型&#xff1a;Array<{title?: string, description?: string}>&#xff0c;默认 [] 当前选中的步骤&#xff0c;设置 v-model 后&a…

CSS3动画——steps函数

CSS3动画中应用的定时函数&#xff08;timing function&#xff09;常用的有内置关键字linear, ease, ease-in, ease-out, ease-in-out, step-start, step-end&#xff0c;另外还有两个内置的缓动函数cubic-bezier(), steps() 其中steps()这个函数是将整个动画过程分为指定的步…

css3中animation的steps分步动画

css的animation中&#xff0c;有一种描述动画变化速率的东西&#xff0c;例如常见的linear,ease-in,ease-out等&#xff0c;这些都是连续的变化&#xff0c;还有一种叫做steps的&#xff0c;它用来描述一种不连续的动画&#xff0c;也就是逐帧动画。 基本认识 steps的格式为&…

超几何分布(Hypergeometric distribution)

超几何分布 百度解释 https://baike.baidu.com/item/超几何分布/4782968?fraladdin 通俗解释 超几何分布中的参数是M,N,n&#xff0c;超几何分布记作X~H(N,M,n) 。假如一共有100颗球&#xff0c;20颗为红球&#xff0c;80颗为白球&#xff0c;从中不放回地拿出10个球&#x…

机器学习小组知识点12:超几何分布(Hyper-Geometric Distribution)

超几何分布与二项分布的联系与区别 事实上,超几何分布和二项分布确实有着密切的联系&#xff0c;但也有明显的区别。   课本对于超几何分布的定义是这样的&#xff1a;一般的&#xff0c;若一个随机变量X的分布列为&#xff0c;其中&#xff0c;则称X服从超几何分布&#xf…

常见分布总结-高斯分布、伯努利分布、泊松分布、几何分布、beta分布

概率分布 概率分布是指用于表述随机变量取值的概率规律,包括连续分布和离散分布。 下面作了这些概率分布的一个思维导图。 文章目录 概率分布1、离散概率分布1.1、两点分布2.2、 二项分布1.3、几何分布1.4、超几何分布1.5、泊松分布2、连续概率分布2.1、均匀分布2.2、正太分布…

超几何分布的其他形式及其解释?

超几何分布定义 百度百科&#xff1a;超几何分布是统计学上一种离散概率分布。它描述了从有限N个物件&#xff08;其中包含M个指定种类的物件&#xff09;中抽出n个物件&#xff0c;成功抽出该指定种类的物件的次数&#xff08;不放回&#xff09;。称为超几何分布&#xff0c;…