<template>
  <div class="content-box">
    <div
      :style="{
        background: backgroundColorBox,
      }"
      class="progress-box"
    >
      <div
        :style="{
          background: backgroundColorInner,
          width: width + '%',
        }"
      >
      </div>
    </div>
    <img
      v-if="iconType == 1"
      :src="bar01"
      :style="{
        left: width + '%',
      }"
    />
    <img
      v-if="iconType == 2"
      :src="bar02"
      :style="{
        left: width + '%',
      }"
    />
    <img
      v-if="iconType == 3"
      :src="yunIcon"
      :style="{
        left: width + '%',
      }"
    />
  </div>
</template>
<script lang="ts" setup>
import titleIcon from '../../assets/images/weatheHome/title-icon.png';
import bar01 from '../../assets/images/weatheHome/bar01.png';
import bar02 from '../../assets/images/weatheHome/bar02.png';
import yunIcon from '../../assets/images/weatheHome/yun-icon.png';
const props = defineProps({
  // 背景颜色
  backgroundColorBox: { type: String },
  // 进度条背景色
  backgroundColorInner: { type: String },
  width: { type: Number },
  iconType: { type: Number },
});
console.log(props);
const devicesImg = {
  titleIcon: titleIcon,
};
</script>
<style lang="less" scoped>
.progress-box {
  width: 100%;
  height: 8px;
  border-radius: 20px;
  position: relative;
  // background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  div {
    height: 100%;
    // width: 50%;
    position: relative;
  }
}
.content-box {
  position: relative;

  img {
    display: block;
    z-index: 1;
    position: absolute;
    top: -5px;
    margin-left: -5px;
  }
}
</style>
