首页 > 其他分享 >carousel 轮播自定义进度条

carousel 轮播自定义进度条

时间:2024-03-12 11:34:56浏览次数:18  
标签:count name 自定义 进度条 color background 10px border 轮播

<!-- Vue SFC -->
<template>
  <div class="propor-box">
    <div class="p20">
      <div>
        <el-carousel :interval="5000" arrow="always" height="250px">
          <el-carousel-item v-for="item in totalPages" :key="item">
            <div>
              <div v-for="(i, index) in carouselPageFn(item)" :key="index">
                <div class="flexba">
                  <span>{{ i.name }}</span>
                  <span>{{ i.count }}</span>
                </div>
                <div class="mb10">
                  <div class="base_information">
                    <div class="tixing">
                      <div
                        class="tixing_text tixing-back3"
                        :style="{
                          width: (i.count / 100) * 100 + '%',
                        }"
                      ></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </el-carousel-item>
        </el-carousel>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  data () {
    return {
      FormData: {},
      baseList: [
        { name: '实例1', count: 50 },
        { name: '实例2', count: 10 },
        { name: '实例3', count: 90 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 40 },
        { name: '实例4', count: 20 },
        { name: '实例4', count: 10 },
      ],
      pageSize: 4,
      type: 1,
    };
  },
  created () { },
  mounted () { },

  computed: {
    totalPages () {
      return Math.ceil(this.baseList.length / this.pageSize);
    },
  },
  methods: {
    getData (row) {

      this.FormData = row;
      this.baseList = row.baseList;
    },
    carouselPageFn (page) {
      const start = (page - 1) * this.pageSize;
      const end = start + this.pageSize;
      return this.baseList.slice(start, end);
    },
  },
};
</script>
<style lang="scss" scoped>
.propor-box {
  box-sizing: border-box;
  // position: absolute;
  // bottom: 10px;
  // left: 0;
  width: 100%;
}
.icon_transform {
  transform: rotate(90deg);
}
.tabs_class {
  background-color: #484c6f;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
}
.tabs_class1 {
  background-color: #484c6f;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  margin-left: -12px;
}
.tabs_bgc {
  background-color: #0088fe;
  z-index: 100;
}
/deep/.el-carousel--horizontal {
  overflow-y: hidden;
}
/deep/.el-carousel__arrow {
  top: 235px;
  background-color: #313359 !important;
  width: 20px !important;
  height: 20px !important;
}
/deep/ .el-carousel__indicator--horizontal .el-carousel__button {
  width: 10px;
  height: 10px;
  background: #616775;
  border: 1px solid 616775;
  border-radius: 50%;
  opacity: 0.5;
}
/deep/ .el-carousel__indicator--horizontal.is-active .el-carousel__button {
  width: 10px;
  height: 10px;
  background: #5d93ed;
  border-radius: 50%;
  opacity: 1;
}
/deep/.el-progress__text {
  margin-left: 20px;
  color: #dedee4;
}
.base_information {
  width: 100%;
  height: 10px;
  background-color: #424c65;
  border-radius: 5px;
}
.tixing {
  position: relative;
  width: 100%;
  height: 10px;
  line-height: 10px;
  background-color: #303462;
  border-radius: 6px;
  overflow: hidden;
  .tixing_text {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    border-radius: 5px;
    height: 100%;
  }
  .tixing-pro {
    color: #fff;
    padding-left: 10px;
    border-radius: 6px;
    overflow: hidden;
  }
  .tixing-back0 {
    background-color: #7948ea;
  }
  .tixing-back1 {
    background-color: #00baad;
  }
  .tixing-back2 {
    background-color: #3478ef;
  }
  .tixing-back3 {
    background-color: #3478ef;
  }
  .tixing-num {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 10;
    padding-right: 30px;
  }
}
</style>

 

标签:count,name,自定义,进度条,color,background,10px,border,轮播
From: https://www.cnblogs.com/dianzan/p/18067923

相关文章

  • cnetos7 ISO 镜像自定义制作
    简介:  此自定义镜像针对centos7系统版本,通过tar打包原系统服务将其放入ISO镜像中在安装时执行解压导入新安装系统中实现系统服务的自定义安装。针对cnetos7目前只测试出这一种方案,暂时没找到其他好的方案实现系统的模板ISO制作,目前版本存在缺陷镜像中的tar包非加密......
  • Vue3自定义指令实现权限控制
    使用Pinia(Vue.js的轻量级状态管理库,是Vuex的替代品)来管理用户权限,并结合自定义指令控制元素的显隐。步骤操作如下:1、安装Pinia:npminstallpinia或yarnaddpinia解释:安装Pinia库,这是一个轻量级的状态管理库,适用于Vue3。2、创建PiniaStore://stores/user.jsimport{......
  • SpringBoot自定义validation注解校验参数只能为指定的值
    需求:实体类中某个属性的值必须为指定的值,比如0或者1SpringBoot版本:2.4.8validation 依赖<!--数据校验--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-validation</artifactId></dependency>......
  • Qt 自定义控件
    参考:https://blog.csdn.net/danshiming/article/details/134383612https://blog.csdn.net/u011832219/article/details/128531359 1、创建自定义控件新建qt项目(项目1),选择其他项目中的“Qt设计师自定义控件”,构建套件的版本类型需要与'帮助'列表中'AboutQtCreator'弹窗的......
  • uniapp自定义导航栏
    uniapp项目自定义顶部导航栏1.创建组件完整代码navigation.vue<template><viewclass="navbar-header":style="isfixed?'padding-top'+navHeight+'px':'padding-top:0px'"><viewclass="navbarcustom......
  • RAG实战5-自定义prompt
    RAG实战5-自定义prompt在阅读本文之前,先阅读RAG实战4。在RAG实战4中我们分析了LlamaIndex中RAG的执行过程,同时留下了一个尚待解决的问题:LlamaIndex中提供的prompttemplate都是英文的,该如何使用中文的prompttemplate呢?直接看以下代码:importloggingimportsysimporttorchf......
  • 自定义事件提醒程序
    因为各大软件无法实现每隔自定义固定天数进行事件提醒的功能,在此用Python写了一个简易的Windows端事件提醒弹窗程序。注意没有做界面,只是把事件写死在了程序中,设置为开机自启动,挂在后台一直运行(cpu占用率几乎为0%),到点就会进行弹窗提醒。Step0.环境配置建议新建一个环境,后面用......
  • vue项目引入自定义svg
    图标可以使用element-ui的图标库、第三方的图标库或者引入svg使用,这里是讲如何使用自定义的svg。将SVG图标放入项目 自定义的svg可以访问 https://www.iconfont.cn地址,搜索你想要的图标,下载SVG格式,放入项目的src/assets/icons/svg文件夹中。并在src/assets/icons/index.js......
  • 向TreeView添加自定义信息
    可在Windows窗体TreeView控件中创建派生节点,或在ListView控件中创建派生项。通过派生可添加任何所需字段,以及添加处理这些字段的自定义方法和构造函数。此功能的用途之一是将Customer对象附加到每个树节点或列表项。虽然此处的示例是关于TreeView控件的,但该方法同样......
  • Mysql和Oracle自定义函数区别
    1.Mysql自定义函数dropfunctionifexistsget_date;createfunctionget_date(v_datetimedatetime,v_timevarchar(50))returnsvarchar(50)begin declarev_datevarchar(50); declarecDatevarchar(50); declarebeginDatevarchar(50); setcDate=date_format(......