分享一个最近写的进度条滑动组件,以前都是用jq写,学会了vue,尝试着拿vue来写觉得非常简单,代码复用性很强!
效果图如下:
调用组件如下:
{{scale*100}}
.box{margin:100px auto 0;width:80%}
.clear:after{content:'';display:block;clear:both}
.slider{position:relative;margin:20px 0;width:400px;height:10px;background:#e4e7ed;border-radius:5px;cursor:pointer}
.slider .process{position:absolute;left:0;top:0;width:112px;height:10px;border-radius:5px;background:#409eff}
.slider .thunk{position:absolute;left:100px;top:-7px;width:20px;height:20px}
.slider .block{width:20px;height:20px;border-radius:50%;border:2px solid #409eff;background:rgba(255,255,255,1);transition:.2s all}
.slider .tips{position:absolute;left:-7px;bottom:30px;min-width:15px;text-align:center;padding:4px 8px;background:#000;border-radius:5px;height:24px;color:#fff}
.slider .tips i{position:absolute;margin-left:-5px;left:50%;bottom:-9px;font-size:16px;color:#000}
.slider .block:hover{transform:scale(1.1);opacity:.6}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



