用CSS写一个进度条

64 阅读1分钟

效果图:

image.png

代码

<template>
     <div>
          <div class="g-container">
            <div class="g-progress"></div>
          </div>
     </div>
</template>

<style scoped>
.g-container {
  display: flex;
  width: 240px;
  height: 25px;
  border-radius: 25px;
  background: #eee;
}

.g-progress {
  width: 30%;
  height: inherit;
  border-radius: 25px 0 0 25px;
  background: #0f0;
}
</style>