elmentui的Steps 步骤条样式改造
话不多说 上代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | <template> <div style= "padding:30px;height: 300px;" > <el-alert :closable= "false" title= "menu 2" /> <el-steps :active= "active" finish-status= "success" > <el-step title= "步骤1" description= "这是一段很长很长很长的描述性文字" > <span slot= "title" style= "自定义样式" /> description可有多个取决于节点需要 <span slot= "description" style= "自定义样式" /> <span slot= "description" style= "自定义样式" /> </el-step> <el-step title= "步骤 1" icon= "el-icon-sort-up" >a</el-step> <el-step title= "步骤 2" icon= "el-icon-sort-up" >a</el-step> <el-step title= "步骤 3" icon= "el-icon-sort-up" >a</el-step> </el-steps> <el-button style= "margin-top: 12px;" @click= "next" >下一步</el-button> <el-steps direction= "vertical" :active= "1" > <el-step title= "步骤 1" /> <el-step title= "步骤 2" /> <el-step title= "步骤 3" description= "这是一段很长很长很长的描述性文字" /> </el-steps> <el-steps :active= "milepostActive" > <el-step v- for = "(value, key) in milepost" :key= "key" : class = "milepostActive== key+1 ? stepActive: noActive " :title= "value.title" :description= "value.description" /> </el-steps> </div> </template> <script> export default { data() { return { active: 0, // 数组对象 milepost: [ { title: '项目策划' , description: '2019.1.1' }, { title: '立项' , description: '2019.3.1' }, { title: '需求' , description: '2019.5.1' }, { title: '开发' , description: '2019.7.1' }, { title: '测试' , description: '2019.9.1' }, { title: '发布' , description: '2019.11.1' }, { title: '结项' , description: '2019.12.31' } ], // 默认步骤数 milepostActive: 5, // 动态添加类名 stepActive: 'stepActive' , noActive: 'noActive' } }, methods: { next() { if ( this .active++ > 3) this .active = 0 } // mouseOver(){ // } } } </script> <style lang= "scss" > .el-step.is-horizontal.noActive{ .el-step__head.is-finish{ // .el-step__line{ // // 当前步骤数横线样式设置 // .el-step__line-inner{ // width: 50% !important; // border-width: 1px !important; // } // } // 当前步骤数圆圈样式设置 .el-step__icon.is-text{ background: rgb(146, 224, 146); color: #fff; } } } .el-step.is-horizontal.stepActive{ .el-step__head.is-finish{ .el-step__line{ // 当前步骤数横线样式设置 .el-step__line-inner{ width: 50% !important; border-width: 1px !important; } } // 当前步骤数圆圈样式设置 .el-step__icon.is-text{ background: red; color: #fff; } } } </style> |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通